代码改变世界

随笔档案-2011年04月

监控线程池ThreadPool

2011-04-15 11:30 by 通心菜, 719 阅读, 收藏,
摘要: 监控线程池 运行完毕int WorkItem = 0;System.Threading.Semaphore hore;在要循环插入的地方//信号量 每次最多5个 可以不要这个hore = new Semaphore(5, 5);foreach(object o in object o2){//计数Interlocked.Increment(ref WorkItem);ThreadPool.QueueUserWorkItem(new WaitCallback(Registe), siteList);}//在开一个Thread去跑这个 private void WaitDone() { Threa 阅读全文

webBrowser 设置文本框

2011-04-12 18:58 by 通心菜, 643 阅读, 收藏,
摘要: private void Form1_Load(object sender, EventArgs e) { this.webBrowser1.Navigate("http://www.baidu.com"); this.webBrowser1.ScriptErrorsSuppressed = true; //禁用右键菜单 this.webBrowser1.IsWebBrowserContextMenuEnabled = false; //禁用键盘快捷键 this.webBrowser1.WebBrowserShortcutsEnabled = false; //打开IE打印 阅读全文

因为数据库正在使用,所以无法获得对数据库的独占访问权

2011-04-06 22:07 by 通心菜, 572 阅读, 收藏,
摘要: 因为数据库正在使用,所以无法获得对数据库的独占访问权ALTERDATABASE[datebase]SETOFFLINEWITHROLLBACKIMMEDIATE 阅读全文