摘要:
private void button1_Click(object sender, EventArgs e) { Thread thread = new Thread(new ThreadStart(display)); thread.S... 阅读全文
摘要:
/// /// 强制转换GridView的数据为DataTable /// /// 需换换的GridView /// 返回DataTable public DataTable GetDgvToTable(Dat... 阅读全文
摘要:
//十进制转二进制Convert.ToString(10, 2);//十进制转八进制Convert.ToString(10, 8);//十进制转十六进制Convert.ToString(10, 16);//二进制转十进制Convert.ToInt32("1010", 2)//八进制转十进制Conve... 阅读全文
摘要:
近日偶然看得一多线程之编程,有传参,有返回值等,来不及测试,先行记录:第一种:无参,无返回值(void)方法Thread th = new Thread(new ThreadStart(PrintName)); public void PrintName() // 函数 { ... 阅读全文
摘要:
写段相同的代码测试一下两者的性能,看两者各自的用时分别是多长时间:第一段:public static void UserString() { string @string = ""; DateTime startTime = DateTime.Now; for (int i = 0... 阅读全文
摘要:
1. System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName获取模块的完整路径,包括文件名。2. System.Environment.CurrentDirectory获取和设置当前目录(该进程从中启动的目录)的完全限定目... 阅读全文
摘要:
1.当用sqlserver身份登录时,将会报错,因为此时数据一登录就占用了,解决方法:使用Windows身份验证方式登录并进行恢复。2.用连接数据库使用的用户,比如sa,或者其他的用户,双击用户名,在弹出的页面中修改“默认数据库”为master或者其他的库,修改完成后保存。再还原数据库文件即可。 阅读全文
摘要:
1、dataGridViewX2.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;//设置列标题文字居中2、dataGridViewX2.DefaultCellStyle.Alig... 阅读全文
摘要:
若是在窗体创建后注册了自定义的事件,需要在关闭窗体后注销事件,否则有可能将会报不能调用的错误.如创建窗体时:CommonClass.comm_event += new CommonClass.comm_delegate(Frm_公共窗体_Comm_event);//注册自定义委托事件那么关闭时也应注... 阅读全文
摘要:
/// /// 执行DataTable中的查询返回新的DataTable /// /// 源数据DataTable /// 查询条件 /// private DataTable GetNewData... 阅读全文