摘要:先建立一个WebApplicationWeb.config --> Server.ashxusing System;using System.Data;using System.Web;using System.Collections;using ...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Text;using System.Net.Sockets;using System.Net;using Common;using System.Threading;using Sy...
阅读全文
摘要:Control.Invalidate方法:使控件的特定区域无效并向控件发送绘制消息。通常情况下,用Invalidate()使区域无效就可触发该控件的重画了,但在一些条件下却没有触发重画.例如: private void button1_Click(object sender, EventArg...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication2{ public class Plan { publ...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Text;using Microsoft.Win32;using System.Threading;using System.IO;using System.Security.Cry...
阅读全文
摘要:假设在得到窗体中控件的句柄(通过SPY++)的前提下,如果是像文本框这种控件,只要用SendMessage就可得到文本了,但是对于聊天记录窗口却行不通(返回空值),因为那其实是一个内置浏览器Internet Explorer_Server经查询,可用以下方式获取:先引用:mshtmlusing Sy...
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Net;namespace ConsoleApplication...
阅读全文
摘要:对于线程重入,在C#中有lock关键字锁住一个SyncObject,而SQL Server也可用一个表来模拟实现。 先创建一个同步表,相当于C#中的SyncObject,并插入一条记录(初始值为1) create table SyncTable(id bit)goinsert into SyncTable (id) values (1)然后假设有个存储过程,有一系列操作,需要防止多线程同时访问到,...
阅读全文
摘要:namespace Common{ public class Tools { public string Process(string content, int startIndex, int length) { string resul...
阅读全文
摘要:C# async await 学习笔记1(http://www.cnblogs.com/siso/p/3691059.html)提到了ThreadId是一样的,突然想到在WinForm中,非UI线程是无法直接更新UI线程上的控件的问题。于是做了如下测试:using System;using Syst...
阅读全文
摘要:由于我的开发工具为vs.net 2010(.net 4.0),需先做以下两步才能进行:1.下载并安装Async CTP (http://www.microsoft.com/en-us/download/details.aspx?id=9983)2.添加AsyncCtpLibrary.dll的引用,我...
阅读全文