• 大小: 0.26M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: WinFrom  加载  

资源简介

多线程执行耗时操作,为了用户体验,显示正在加载效果。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BackGroudWorkerTest
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            _demoBGWorker.DoWork += BGWorker_DoWork;
            _demoBGWorker.WorkerReportsProgress = true;
            _demoBGWorker.WorkerSupportsCancellation = true;
            _demoBGWorker.ProgressChanged += BGWorker_ProgressChanged;
            _demoBGWorker.RunWorkerCompleted += BGWorker_RunWorkerCompleted;

        }

        private void BGWorker_RunWorkerCompleted(object sende

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-10-22 11:30  WindowsFormsApplication16\
     目录           0  2017-10-01 14:55  WindowsFormsApplication16\.vs\
     目录           0  2017-10-01 14:55  WindowsFormsApplication16\.vs\WindowsFormsApplication16\
     目录           0  2017-10-01 14:55  WindowsFormsApplication16\.vs\WindowsFormsApplication16\v14\
     文件      136704  2017-11-17 20:45  WindowsFormsApplication16\.vs\WindowsFormsApplication16\v14\.suo
     目录           0  2017-10-22 15:11  WindowsFormsApplication16\BackGroudWorkerTest\
     文件         189  2017-10-22 11:30  WindowsFormsApplication16\BackGroudWorkerTest\App.config
     文件        3936  2017-10-22 11:37  WindowsFormsApplication16\BackGroudWorkerTest\BackGroudWorkerTest.csproj
     目录           0  2017-10-22 11:30  WindowsFormsApplication16\BackGroudWorkerTest\bin\
     目录           0  2017-10-22 11:37  WindowsFormsApplication16\BackGroudWorkerTest\bin\Debug\
     文件       10240  2017-10-22 15:11  WindowsFormsApplication16\BackGroudWorkerTest\bin\Debug\BackGroudWorkerTest.exe
     文件         189  2017-10-22 11:30  WindowsFormsApplication16\BackGroudWorkerTest\bin\Debug\BackGroudWorkerTest.exe.config
     文件       22016  2017-10-22 15:11  WindowsFormsApplication16\BackGroudWorkerTest\bin\Debug\BackGroudWorkerTest.pdb
     文件       22696  2017-10-22 18:01  WindowsFormsApplication16\BackGroudWorkerTest\bin\Debug\BackGroudWorkerTest.vshost.exe
     文件         189  2017-10-22 11:30  WindowsFormsApplication16\BackGroudWorkerTest\bin\Debug\BackGroudWorkerTest.vshost.exe.config
     文件         490  2015-07-10 19:01  WindowsFormsApplication16\BackGroudWorkerTest\bin\Debug\BackGroudWorkerTest.vshost.exe.manifest
     文件        4203  2017-10-22 15:11  WindowsFormsApplication16\BackGroudWorkerTest\Form1.cs
     文件        3794  2017-10-22 11:51  WindowsFormsApplication16\BackGroudWorkerTest\Form1.Designer.cs
     文件        5817  2017-10-22 11:51  WindowsFormsApplication16\BackGroudWorkerTest\Form1.resx
     目录           0  2017-10-22 11:30  WindowsFormsApplication16\BackGroudWorkerTest\obj\
     目录           0  2017-11-18 17:51  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\
     文件        1014  2017-10-22 18:01  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\BackGroudWorkerTest.csproj.FileListAbsolute.txt
     文件         976  2017-10-22 11:51  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\BackGroudWorkerTest.csproj.GenerateResource.Cache
     文件        2384  2017-10-22 12:33  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\BackGroudWorkerTest.csprojResolveAssemblyReference.cache
     文件       10240  2017-10-22 15:11  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\BackGroudWorkerTest.exe
     文件         180  2017-10-22 11:51  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\BackGroudWorkerTest.Form1.resources
     文件       22016  2017-10-22 15:11  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\BackGroudWorkerTest.pdb
     文件         180  2017-10-22 11:37  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\BackGroudWorkerTest.Properties.Resources.resources
     文件        1464  2017-11-18 17:51  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\DesignTimeResolveAssemblyReferences.cache
     文件        7215  2017-10-22 11:30  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     文件           0  2017-10-22 11:30  WindowsFormsApplication16\BackGroudWorkerTest\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
............此处省略128个文件信息

评论

共有 条评论