CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 C#编程

文件名称:ranSelect

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2012-11-16
  • 文件大小:
    173.19kb
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

C#四种方式实现对用户操作响应灵敏及可动态更新的窗体控件及其对比



随机抽奖应用为例 开发环境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/ranSelectBackgroundWorker.suo
ranSelectBackgroundWorker/WindowsFormsApplication6/bin/Debug/ranSelectBackgroundWorker.vshost.exe
ranSelectBackgroundWorker/WindowsFormsApplication6/bin/Debug/ranSelectBackgroundWorker.vshost.exe.manifest
ranSelectBackgroundWorker/WindowsFormsApplication6/frmMain.cs
ranSelectBackgroundWorker/WindowsFormsApplication6/frmMain.Designer.cs
ranSelectBackgroundWorker/WindowsFormsApplication6/frmMain.resx
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/GenerateResource.read.1.tlog
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/GenerateResource.write.1.tlog
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/ranSelectBackgroundWorker.csproj.FileListAbsolute.txt
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/ranSelectBackgroundWorker.exe
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/ranSelectBackgroundWorker.Form1.resources
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/ranSelectBackgroundWorker.frmMain.resources
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/ranSelectBackgroundWorker.pdb
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/ranSelectBackgroundWorker.Properties.Resources.resources
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/ResolveAssemblyReference.cache
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll
ranSelectBackgroundWorker/WindowsFormsApplication6/obj/x86/Debug/WindowsFormsApplication6.csproj.FileListAbsolute.txt
ranSelectBackgroundWorker/WindowsFormsApplication6/Program.cs
ranSelectBackgroundWorker/WindowsFormsApplication6/Properties/AssemblyInfo.cs
ranSelectBackgroundWorker/WindowsFormsApplication6/Properties/Resources.Designer.cs
ranSelectBackgroundWorker/WindowsFormsApplication6/Properties/Resources.resx
ranSelectBackgroundWorker/WindowsFormsApplication6/Properties/Settings.Designer.cs
ranSelectBackgroundWorker/WindowsFormsApplication6/Properties/Settings.settings
ranSelectBackgroundWorker/WindowsFormsApplication6/ranSelectBackgroundWorker.csproj
ranSelectBackgroundWorker/WindowsFormsApplication6.suo
ranSelectDelegate/ranSelectDelegate.sln
ranSelectDelegate/ranSelectDelegate.suo
ranSelectDelegate/WindowsFormsApplication7/bin/Debug/ranSelectDelegate.vshost.exe
ranSelectDelegate/WindowsFormsApplication7/bin/Debug/ranSelectDelegate.vshost.exe.manifest
ranSelectDelegate/WindowsFormsApplication7/Class1.cs
ranSelectDelegate/WindowsFormsApplication7/frmMain.cs
ranSelectDelegate/WindowsFormsApplication7/frmMain.Designer.cs
ranSelectDelegate/WindowsFormsApplication7/frmMain.resx
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/GenerateResource.read.1.tlog
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/GenerateResource.write.1.tlog
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/ranSelectDelegate.exe
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/ranSelectDelegate.frmMain.resources
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/ranSelectDelegate.pdb
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/ranSelectDelegate.Properties.Resources.resources
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/ResolveAssemblyReference.cache
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/TempPE/Properties.Resources.Designer.cs.dll
ranSelectDelegate/WindowsFormsApplication7/obj/x86/Debug/WindowsFormsApplication7.csproj.FileListAbsolute.txt
ranSelectDelegate/WindowsFormsApplication7/Program.cs
ranSelectDelegate/WindowsFormsApplication7/Properties/AssemblyInfo.cs
ranSelectDelegate/WindowsFormsApplication7/Properties/Resources.Designer.cs
ranSelectDelegate/WindowsFormsApplication7/Properties/Resources.resx
ranSelectDelegate/WindowsFormsApplication7/Properties/Settings.Designer.cs
ranSelectDelegate/WindowsFormsApplication7/Properties/Settings.settings
ranSelectDelegate/WindowsFormsApplication7/WindowsFormsApplication7.csproj
ranSelectDelegate/WindowsFormsApplication7.suo
ranSelectMultiThread/ranSelectMultiThread.sln
ranSelectMultiThread/ranSelectMultiThread.suo
ranSelectMultiThread/WindowsFormsApplication8/bin/Debug/WindowsFormsApplication8.vshost.exe
ranSelectMultiThread/WindowsFormsApplication8/bin/Debug/WindowsFormsApplication8.vshost.exe.manifest
ranSelectMultiThread/WindowsFormsApplication8/frmMain.cs
ranSelectMultiThread/WindowsFormsApplication8/frmMain.Designer.cs
ranSelectMultiThread/WindowsFormsApplication8/frmMain.resx
ranSelectMultiThread/WindowsFormsApplication8/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache
ranSele

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com