文件名称:ranSelect
- 所属分类:
- C#编程
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 173kb
- 下载次数:
- 0次
- 提 供 者:
- Joh***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
C#四种方式实现对用户操作响应灵敏及可动态更新的窗体控件及其对比
随机抽奖应用为例 开发环境vs2010
timer,backGroundWorker,多线程,委托四种方式的对比:
1.4种方式都可以实现要求 可谓条条大路通罗马
2.多线程和委托需要强行禁用CheckForIllegalCrossThreadCalls,有可能存在运行安全问题,但目前还没遇到
3.timer的源代码最少最简单 其次是多线程
4.委托本质上还是要用到多线程 区别在于委托是通过消息和事件的方式同步协调线程之间的配合 Observer设计模式
5.多线程和委托需要自己处理资源释放 否则程序非正常退出时会仍然驻留内存
6.backGroundWorker看来是微软针对此要求度身定做的成熟组件,封装了线程、同步协调及资源释放,又没有运行安全问题的担心
7.性能哪个最好?有空导几万条数据再测试啦
4个源代码中 backGroundWorker的源代码是最完整的 还对既公平又高效的随机抽奖算法进行了一些探讨 详见源代码注释
其他3个源代码只实现基本要求-random select user
随机抽奖应用为例 开发环境vs2010
timer,backGroundWorker,多线程,委托四种方式的对比:
1.4种方式都可以实现要求 可谓条条大路通罗马
2.多线程和委托需要强行禁用CheckForIllegalCrossThreadCalls,有可能存在运行安全问题,但目前还没遇到
3.timer的源代码最少最简单 其次是多线程
4.委托本质上还是要用到多线程 区别在于委托是通过消息和事件的方式同步协调线程之间的配合 Observer设计模式
5.多线程和委托需要自己处理资源释放 否则程序非正常退出时会仍然驻留内存
6.backGroundWorker看来是微软针对此要求度身定做的成熟组件,封装了线程、同步协调及资源释放,又没有运行安全问题的担心
7.性能哪个最好?有空导几万条数据再测试啦
4个源代码中 backGroundWorker的源代码是最完整的 还对既公平又高效的随机抽奖算法进行了一些探讨 详见源代码注释
其他3个源代码只实现基本要求-random select user
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ranSelectBackgroundWorker\ranSelectBackgroundWorker.sln
.........................\ranSelectBackgroundWorker.suo
.........................\WindowsFormsApplication6\bin\Debug\ranSelectBackgroundWorker.vshost.exe
.........................\........................\...\.....\ranSelectBackgroundWorker.vshost.exe.manifest
.........................\........................\frmMain.cs
.........................\........................\frmMain.Designer.cs
.........................\........................\frmMain.resx
.........................\........................\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
.........................\........................\...\...\.....\DesignTimeResolveAssemblyReferencesInput.cache
.........................\........................\...\...\.....\GenerateResource.read.1.tlog
.........................\........................\...\...\.....\GenerateResource.write.1.tlog
.........................\........................\...\...\.....\ranSelectBackgroundWorker.csproj.FileListAbsolute.txt
.........................\........................\...\...\.....\ranSelectBackgroundWorker.exe
.........................\........................\...\...\.....\ranSelectBackgroundWorker.Form1.resources
.........................\........................\...\...\.....\ranSelectBackgroundWorker.frmMain.resources
.........................\........................\...\...\.....\ranSelectBackgroundWorker.pdb
.........................\........................\...\...\.....\ranSelectBackgroundWorker.Properties.Resources.resources
.........................\........................\...\...\.....\ResolveAssemblyReference.cache
.........................\........................\...\...\.....\TempPE\Properties.Resources.Designer.cs.dll
.........................\........................\...\...\.....\WindowsFormsApplication6.csproj.FileListAbsolute.txt
.........................\........................\Program.cs
.........................\........................\...perties\AssemblyInfo.cs
.........................\........................\..........\Resources.Designer.cs
.........................\........................\..........\Resources.resx
.........................\........................\..........\Settings.Designer.cs
.........................\........................\..........\Settings.settings
.........................\........................\ranSelectBackgroundWorker.csproj
.........................\WindowsFormsApplication6.suo
.........Delegate\ranSelectDelegate.sln
.................\ranSelectDelegate.suo
.................\WindowsFormsApplication7\bin\Debug\ranSelectDelegate.vshost.exe
.................\........................\...\.....\ranSelectDelegate.vshost.exe.manifest
.................\........................\Class1.cs
.................\........................\frmMain.cs
.................\........................\frmMain.Designer.cs
.................\........................\frmMain.resx
.................\........................\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
.................\........................\...\...\.....\DesignTimeResolveAssemblyReferencesInput.cache
.................\........................\...\...\.....\GenerateResource.read.1.tlog
.................\........................\...\...\.....\GenerateResource.write.1.tlog
.................\........................\...\...\.....\ranSelectDelegate.exe
.................\........................\...\...\.....\ranSelectDelegate.frmMain.resources
.................\........................\...\...\.....\ranSelectDelegate.pdb
.................\........................\...\...\.....\ranSelectDelegate.Properties.Resources.resources
.................\........................\...\...\.....\ResolveAssemblyReference.cache
.................\........................\...\...\.....\TempPE\Properties.Resources.Designer.cs.dll
.................\........................\...\...\.....\WindowsFormsApplication7.csproj.FileListAbsolute.txt
.................\........................\Program.cs
.................\..............