• 大小: 68KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-11
  • 语言: C#
  • 标签: C#  多线程  多任务  

资源简介

简单winform 多线程 多任务管理 demo 可根据业务进一步扩展开发,如:下载器等

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace TaskManager
{
    public class Executer : IExecuter
    {
        public void Execute()
        {

        }
        #region IExecute
        public Guid TaskId { get; set; }

        public Task Task { get; set; }

        public void Do()
        {
            for (int i = 1; i <= 100; i++)
            {
                if (Task.taskProcess != null)
                {
                    Thread.Sleep(1000);
                    ParaProcess pp = new ParaProcess(TaskId);
                    pp.Rate = (double)i / 100;
                    Task.taskProcess(pp); 
                }
            }
            if (Task.taskStatus != null)
            {
                Task.ChangeStatus(TaskStatus.complete);
            }
        }
        #endregion
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件         875  2015-07-28 14:36  TaskManager\TaskManager.sln
     文件       25088  2015-07-28 17:34  TaskManager\TaskManager.suo
     目录           0  2015-07-28 15:49  TaskManager\TaskManager\
     目录           0  2015-07-28 14:36  TaskManager\TaskManager\bin\
     目录           0  2015-07-28 16:50  TaskManager\TaskManager\bin\Debug\
     文件       18944  2015-07-28 16:58  TaskManager\TaskManager\bin\Debug\TaskManager.exe
     文件       50688  2015-07-28 16:58  TaskManager\TaskManager\bin\Debug\TaskManager.pdb
     文件       11600  2015-07-28 16:56  TaskManager\TaskManager\bin\Debug\TaskManager.vshost.exe
     文件         490  2013-06-18 20:28  TaskManager\TaskManager\bin\Debug\TaskManager.vshost.exe.manifest
     文件         921  2015-07-28 16:50  TaskManager\TaskManager\Execute.cs
     文件       10375  2015-07-28 16:55  TaskManager\TaskManager\Form1.cs
     文件        7156  2015-07-28 16:36  TaskManager\TaskManager\Form1.Designer.cs
     文件        6022  2015-07-28 16:36  TaskManager\TaskManager\Form1.resx
     文件         260  2015-07-28 16:41  TaskManager\TaskManager\IExecute.cs
     目录           0  2015-07-28 14:36  TaskManager\TaskManager\obj\
     目录           0  2015-07-28 14:36  TaskManager\TaskManager\obj\x86\
     目录           0  2015-07-28 16:58  TaskManager\TaskManager\obj\x86\Debug\
     文件        2867  2015-07-28 14:36  TaskManager\TaskManager\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        6326  2015-07-28 16:58  TaskManager\TaskManager\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件         596  2015-07-28 16:56  TaskManager\TaskManager\obj\x86\Debug\TaskManager.csproj.FileListAbsolute.txt
     文件         975  2015-07-28 16:50  TaskManager\TaskManager\obj\x86\Debug\TaskManager.csproj.GenerateResource.Cache
     文件       18944  2015-07-28 16:58  TaskManager\TaskManager\obj\x86\Debug\TaskManager.exe
     文件         180  2015-07-28 16:50  TaskManager\TaskManager\obj\x86\Debug\TaskManager.Form1.resources
     文件       50688  2015-07-28 16:58  TaskManager\TaskManager\obj\x86\Debug\TaskManager.pdb
     文件         180  2015-07-28 16:50  TaskManager\TaskManager\obj\x86\Debug\TaskManager.Properties.Resources.resources
     目录           0  2015-07-28 14:36  TaskManager\TaskManager\obj\x86\Debug\TempPE\
     文件         492  2015-07-28 14:36  TaskManager\TaskManager\Program.cs
     目录           0  2015-07-28 14:36  TaskManager\TaskManager\Properties\
     文件        1354  2015-07-28 14:36  TaskManager\TaskManager\Properties\AssemblyInfo.cs
     文件        2874  2015-07-28 14:36  TaskManager\TaskManager\Properties\Resources.Designer.cs
     文件        5612  2015-07-28 14:36  TaskManager\TaskManager\Properties\Resources.resx
............此处省略7个文件信息

评论

共有 条评论