摘要: BackgroundWorker的对象定义:this.backgroundWorker.WorkerSupportsCancellation = true; this.backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.DoWork); this.backgroundWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Ru... 阅读全文
posted @ 2013-02-16 17:58 Qlx2011 阅读(328) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Windows.Forms;using Microsoft.Win32;private static string GetVersionInfo() { string result = null; RegistryKey key; try { key = Registry.LocalMachine.OpenSubKey(Define.ProductVersionPath); if(k... 阅读全文
posted @ 2013-02-16 17:52 Qlx2011 阅读(390) 评论(0) 推荐(0) 编辑
摘要: 检验某个Service是否存在:using System;using System.ServiceProcess;using System.Windows.Forms;private static bool IsExistSqlServer(string serviceName) { bool result = false; ServiceController[] controllers = ServiceController.GetServices(); int nNum = controllers.Length... 阅读全文
posted @ 2013-02-16 17:46 Qlx2011 阅读(1401) 评论(0) 推荐(0) 编辑
摘要: 查看该文件夹,发现其为只读。将只读取消,然后选择“将更改应用于该文件夹、子文件夹和文件”,然后再编译,成功了。这个文件夹是从TFS2010下载代码时自动建立的,默认是只读。所以需要手工去掉只读属性。 阅读全文
posted @ 2013-02-16 12:28 Qlx2011 阅读(749) 评论(0) 推荐(0) 编辑
摘要: 公司一个老项目,从TFS2010上下载了源代码,编译,2000+错误!基本都是“缺少引用”。在解决方案资源管理器里“引用”下,有很多的叹号!查看源代码所在文件系统目录,结果发现每个项目的bin文件夹下都没有任何dll,怨不得会出这么多的编译错误!后来发现:在解决方案文件系统目录下,有一个独立于任何项目的bin文件夹,里面有几十个dll文件。我将所有dll拷贝到一个项目的bin文件夹下,结果该项目的“引用”中的叹号自动消失了。然后,对于另外一个项目,我根据有叹号的“引用”名称从独立bin里找到所需的dll并拷贝到该项目bin下,然后其叹号也自动消失了。这样就一个项目一个项目地解决了缺少引用问题! 阅读全文
posted @ 2013-02-16 12:05 Qlx2011 阅读(2032) 评论(1) 推荐(1) 编辑