2013年3月5日
摘要: 范例:using System;using System.Diagnostics;using System.Threading;class Program{ static void Main() { // Create new stopwatch Stopwatch stopwatch = new Stopwatch(); // Begin timing stopwatch.Start(); // Do something for (int i = 0; i < 1000; i++) { Thread.Sleep(1); } // Stop timing stopwatch... 阅读全文
posted @ 2013-03-05 15:47 ltyfat 阅读(267) 评论(0) 推荐(0) 编辑
  2013年1月18日
摘要: 问题:为什么c#中要有ref和out?(而java中没有)需求假设:现需要通过一个叫Swap的方法交换a,b两个变量的值。交换前a=1,b=2,断言:交换后a=2,b=1。现编码如下:class Program { static void Main(string[] args) { int a = 1; int b = 2; Console.WriteLine("交换前\ta={0}\tb={1}\t",a,b); Swap(a,b); Console.WriteLine("交换后\ta={0}\tb={1}\t",a,b); Console.Read( 阅读全文
posted @ 2013-01-18 10:24 ltyfat 阅读(117) 评论(0) 推荐(0) 编辑
  2012年11月28日
摘要: 格式模式 说明 d 月中的某一天。一位数的日期没有前导零。dd 月中的某一天。一位数的日期有一个前导零。ddd 周中某天的缩写名称,在 AbbreviatedDayNames 中定义。 dddd 周中某天的完整名称,在 DayNames 中定义。M 月份数字。一位数的月份没有前导零。 MM 月份数字。一位数的月份有一个前导零。MMM 月份的缩写名称,在 AbbreviatedMonthNames 中定义。MMMM 月份的完整名称,在 MonthNames 中定义。y 不包含纪元的年份。如果不包含纪元的年份小于 10,则显示不具有前导零的年份。yy 不包含纪元的年份。如果不包含纪元的年份小... 阅读全文
posted @ 2012-11-28 01:13 ltyfat 阅读(130) 评论(0) 推荐(0) 编辑
  2012年10月30日
摘要: C#文件中GetCommandLineArgs()解释:该函数使用Environment类方法获取命令行参数;使用该函数时 程序名被视为第1参数,命令行中的其他值依次被视为第2 3...个参数.通过一个例子来讲解文件和该函数的用法:using System;using System.IO;class myApp{ public static void Main() { string [] CLA = Enviroment.GetCommandLineArgs(); //获取命令 第一个为文件名 if(CLA.Length<3) //判断获取的字符数组个数是否小于3 { Console.W 阅读全文
posted @ 2012-10-30 17:18 ltyfat 阅读(682) 评论(0) 推荐(0) 编辑
  2012年10月27日
摘要: 怪异的CheckedListBox数据绑定摘要: 今天用到了CheckedListBox,就见到总结一下常用的知识。1、添加项:Items.AddcheckedListBox1.Items.Add("June");checkedListBox1.Items.Add("Jun");2、判断第i项是否选中GetItemChecked(index)chec ...今天用到了CheckedListBox,就见到总结一下常用的知识。1、添加项:Items.AddcheckedListBox1.Items.Add("June");checkedL 阅读全文
posted @ 2012-10-27 18:24 ltyfat 阅读(144) 评论(0) 推荐(0) 编辑
  2012年10月21日
摘要: LinkButton 传递多个参数在使用LinkButton时可能会遇到需要传递多个参数的问题,而LinkButton的用来传递参数的属性commandargument需要传递的是一个string类型的值。因而传递多个参数时需要进行一下处理。前台代码: <dxwgv:GridViewDataHyperLinkColumn FieldName="appName" Caption="应用名" VisibleIndex="1"> <DataItemTemplate> <asp:LinkButton ID=&qu 阅读全文
posted @ 2012-10-21 00:17 ltyfat 阅读(428) 评论(0) 推荐(0) 编辑