随笔分类 -  C#

摘要:以下内容转自http://www.cnblogs.com/musickh/archive/2009/07/16/1524912.html,在此多谢博主!DateTime.Now=2009-7-16 5:20:56//今天DateTime.Now.Date.ToString(); "2009-7-16 0:00:00"//周起始日期DateTime.Now.Date.AddDays(-(int)(DateTime.Now.DayOfWeek)+1).ToString(); {2009-7-13 0:00:00} DateTime.Now.Date.AddDays(7-(int 阅读全文
posted @ 2013-04-23 13:23 louiskoo 阅读(2775) 评论(0) 推荐(0)
摘要:OrderNum = (from s in g from f in dt.JXDW_ITIL_WORK_ORDER where s.CALL_ID == f.CALL_ID && (new string[] { "待回访", "回访中", "关闭" }).Contains(f.ORDER_STATUS) select f).Count(), 阅读全文
posted @ 2013-04-19 13:46 louiskoo 阅读(146) 评论(0) 推荐(0)
摘要:CTime = EntityFunctions.DiffSeconds(f.OPEN_DATE.Value , f.RESOLVED_DATE.Value), 阅读全文
posted @ 2013-04-18 21:50 louiskoo 阅读(3275) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/andamajing/article/details/7386965 阅读全文
posted @ 2013-04-15 14:14 louiskoo 阅读(174) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2013-04-07 13:29 louiskoo 阅读(2378) 评论(0) 推荐(0)
摘要:delegate int del(int i);static void Main(string[] args){ del myDelegate = x => x * x; int j = myDelegate(5); //j = 25}创建表达式树类型:using System.Linq.Expressions;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { Expression<del> myET = x ... 阅读全文
posted @ 2013-04-03 17:13 louiskoo 阅读(159) 评论(0) 推荐(0)
摘要:class Test{ delegate void TestDelegate(string s); static void M(string s) { Console.WriteLine(s); } static void Main(string[] args) { // Original delegate syntax required // initialization with a named method. TestDelegate testDelA = new TestDelegate(M)... 阅读全文
posted @ 2013-04-03 15:45 louiskoo 阅读(208) 评论(0) 推荐(0)
摘要:// Create a handler for a click event.button1.Click += delegate(System.Object o, System.EventArgs e) { System.Windows.Forms.MessageBox.Show("Click!"); };// Create a delegate.delegate void Del(int x);// Instantiate the delegate using an anonymous method.Del d = delegate(int k) { /* ... 阅读全文
posted @ 2013-04-03 15:34 louiskoo 阅读(118) 评论(0) 推荐(0)
摘要:http://msdn.microsoft.com/zh-cn/library/ms173171 阅读全文
posted @ 2013-04-03 15:30 louiskoo 阅读(231) 评论(0) 推荐(0)
摘要:http://msdn.microsoft.com/zh-cn/library/8627sbea 阅读全文
posted @ 2013-04-03 15:21 louiskoo 阅读(77) 评论(0) 推荐(0)
摘要:在C#中,你给一个方法传输参数时,实际上是使用的这个参数的一个副本,就是将原来的变量复制一份,然后传给一个方法,让其进行操作。所以在方法内部对参数的修改等不会对原来的参数造成影响。但是有些时候,又需要这种影响。ref的作用就是这个。它将变量本身而不是副本传给方法,所以对参数的修改原来变量的值。int a = 0;Console.WriteLine(a.ToString()); //输出是0public void ModifyVaule(ref int a){ a = 1;}Console.WriteLine(a.ToString()); // 输出是1。此外,out修饰符也起到这个作用... 阅读全文
posted @ 2013-04-03 13:31 louiskoo 阅读(186) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/jianbin1062/article/details/6093337 阅读全文
posted @ 2013-04-02 10:43 louiskoo 阅读(1947) 评论(0) 推荐(0)
摘要:http://thrift.apache.org/ 阅读全文
posted @ 2013-04-01 21:10 louiskoo 阅读(488) 评论(0) 推荐(0)
摘要:t = new Thread(new ThreadStart(delegate { Play(sender, e); Console.WriteLine("Play ended."); })); t.Start(); private void Play(object sender, EventArgs e) { Console.WriteLine("InvokeRequired = " + InvokeRequired); ... 阅读全文
posted @ 2013-03-28 15:12 louiskoo 阅读(384) 评论(0) 推荐(0)
摘要:Thread thread = new Thread(new ThreadStart(delegate { AuroraSocketClient.Connect("192.168.0.12"); })); thread.Start(); Thread t = new Thread(new ThreadStart(delegate { try { seatDay = SeatAlgorithm.GetSeatTotalDayData(); ... 阅读全文
posted @ 2013-03-27 19:12 louiskoo 阅读(1827) 评论(0) 推荐(0)
摘要:private void timer1_Tick_1(object sender, EventArgs e) { //开辟新线程,不占用主线程 Thread t = new Thread(new ThreadStart(delegate { timer1.Stop(); while (true) { Console.WriteLine("in timer1_Tick_1"); if (result.Count >= number) { Console.WriteLine("result.Count = " + result.Count); Cons 阅读全文
posted @ 2013-03-27 19:11 louiskoo 阅读(2016) 评论(0) 推荐(0)
摘要:可以直接在父窗口定义一个字段为子窗口;使用子窗口的时候就初始化,用完关闭。 阅读全文
posted @ 2013-03-25 16:11 louiskoo 阅读(655) 评论(0) 推荐(0)
摘要:private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.Columns[e.ColumnIndex].CellType.Name == "DataGridViewCheckBoxCell") { //Console.WriteLine(dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Valu... 阅读全文
posted @ 2013-03-25 15:44 louiskoo 阅读(442) 评论(0) 推荐(0)
摘要:private void AddHeaderCheckBox() { HeaderCheckBox = new CheckBox(); HeaderCheckBox.Size = new Size(20, 20); dataGridView1.Controls.Add(HeaderCheckBox); } private void HeaderCheckBox_MouseClick(object sender, MouseEventArgs e) { Heade... 阅读全文
posted @ 2013-03-25 15:43 louiskoo 阅读(627) 评论(0) 推荐(0)
摘要:rowHeadersVisible = false; 阅读全文
posted @ 2013-03-25 15:41 louiskoo 阅读(2257) 评论(0) 推荐(0)