摘要: public class LogHelper { private static string logFolder = AppDomain.CurrentDomain.BaseDirectory + "errorlog"; private static string logFile; /// /// 构造函数 ... 阅读全文
posted @ 2016-07-13 13:36 会弹猫的吉他 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 出现原因: 因为Global类初始化某个静态变量时没有成功则会抛 System.NullReferenceException 异常,具体代码: public static string connstring = System.Configuration.ConfigurationManager.Co 阅读全文
posted @ 2016-07-13 12:55 会弹猫的吉他 阅读(733) 评论(0) 推荐(0) 编辑
摘要: //查询一个表中的某字段为条件修改另一个表的内容 update [VehicleInsuranceAgentConfiguration] set Keyword2=PC.ServerConfig from ProxyConfig PC,VehicleInsuranceAgentConfiguration VIAC where VIAC.CompanyID=PC.CompanyID and VI... 阅读全文
posted @ 2016-07-11 10:11 会弹猫的吉他 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 多线程处理sql server2008某个表中的数据时,在Update记录的时候出现了【Transaction (Process ID 146) was deadlocked on lock resources with another process and has been chosen as 阅读全文
posted @ 2016-07-07 15:38 会弹猫的吉他 阅读(7983) 评论(0) 推荐(0) 编辑
摘要: UPDATE 表名 SET 字段名 = REPLACE (字段名, 'old', 'new'); 阅读全文
posted @ 2016-07-06 12:54 会弹猫的吉他 阅读(1017) 评论(0) 推荐(0) 编辑
摘要: if (MessageBox.Show("你确定要退出程序吗?", "确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK) { //... } 阅读全文
posted @ 2016-06-24 11:27 会弹猫的吉他 阅读(420) 评论(0) 推荐(0) 编辑
摘要: #region 强制清除缓存 [DllImport("kernel32.dll", EntryPoint = "SetProcessWorkingSetSize")] public static extern int SetProcessWorkingSetSize(IntPtr process, int minSize, int maxSize); //////... 阅读全文
posted @ 2016-06-24 11:12 会弹猫的吉他 阅读(2403) 评论(0) 推荐(0) 编辑
摘要: C#中一个RichTextBox,当新写入内容时,超过当前显示区域后,自动滚动到最低端,方便查看内容。 阅读全文
posted @ 2016-06-20 15:57 会弹猫的吉他 阅读(2143) 评论(0) 推荐(0) 编辑
摘要: 一.从String xml到XmlDocument的: 二.将XmlDocument内容 转换成String xml 阅读全文
posted @ 2016-06-15 14:07 会弹猫的吉他 阅读(573) 评论(0) 推荐(0) 编辑
摘要: 一.DataGridView列右击菜单事件处理 (1). 添加一个快捷菜单contextMenuStrip1;(2). 给dataGridView1的CellMouseDown事件添加处理程序: 设置dataGridView1选中一行:将SelectionMode属性值改为FullRowSelect 阅读全文
posted @ 2016-06-12 14:51 会弹猫的吉他 阅读(248) 评论(0) 推荐(0) 编辑