随笔分类 - WinForm
C# Bitmap 复制
摘要:以后再详述,先上代码。 1 public bool CopyBitmap(Bitmap source, Bitmap destination) 2 { 3 if ((source.Width != destination.Width) || (source.Height != destination.Height) || (source.PixelFormat != destination.PixelFormat)) 4 { 5 return false; 6 } 7 8 int bitdepth_per_pixel = Bitmap.GetP...
阅读全文
winform程序未捕获异常解决方法
摘要:在开发winform程序时,用到多线程,在服务器部署后运行,老是自动关才程序,症状描述如下:在Windows Server 2003的操作系统上,运行.Net 2.0或者3.5的应用程序时,会发现没有任何反应,到系统的事件查看器里会发现类似EventType clr20r3 P1....P2...PN的错误提示。很可能的原因就是:应用程序出现了异常,而.net没有或者无法捕捉该异常,所以导致出现如下情况:1.程序自动关闭。2.此时去任务管理器中会看到一个DW20.exe的进程,不久会自动消失3.到事件查看器里面会发现类似EventType clr20r3 P1....P2...PN的错误提示。
阅读全文