摘要: 转义序列 产生的字符 字符的Unicode值 \' 单引号 0x0027 \" ... 阅读全文
posted @ 2006-12-27 17:41 tiasys 阅读(617) 评论(0) 推荐(0) 编辑
摘要: 1//----------------------------------------------- 2父窗口代码 3 4//----------------------------------------------- 5 public Main() 6 { 7 InitializeComponent(); 8 //启用Windows ... 阅读全文
posted @ 2006-12-27 17:40 tiasys 阅读(521) 评论(0) 推荐(0) 编辑
摘要: 1可以用循环ListView的方法:条件是要求listView要加入DataSet的结构要相同 2 for(int i=0;i<this.listView1.items.count;i++) 3 { 4 DataRow row= this.MyDataSet.Tables[0].NewRow(); 5 row["列1"]=thi... 阅读全文
posted @ 2006-12-27 17:38 tiasys 阅读(2308) 评论(0) 推荐(0) 编辑
摘要: 1//********************************************************************* 2 // 3 // TTSecurity Class 4 // 5 // The TimeTrackerSecurity class encapsulates two helper methods that enabl... 阅读全文
posted @ 2006-12-27 17:37 tiasys 阅读(265) 评论(0) 推荐(0) 编辑
摘要: 1//********************************************************************* 2 // 3 // DirectoryHelper Class 4 // 5 // Uses the DirectorySearcher .NET Framework class to retrieve user in... 阅读全文
posted @ 2006-12-27 17:36 tiasys 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 1件运算符 (?:) 根据布尔型表达式的值返回两个值中的一个。条件运算符的格式如下 2 3 复制代码 4condition ? first_expression : second_expression; 5 6 7备注 8如果条件为 true,则计算第一表达式并以它的计算结果为准;如果为 false,则计算第二表达式并以它的计算结果为准。只计算两个表达式中的一个。 910使用条件运算符,... 阅读全文
posted @ 2006-12-27 17:36 tiasys 阅读(520) 评论(0) 推荐(0) 编辑
摘要: 1using System; 2using System.Collections.Generic; 3using System.ComponentModel; 4using System.Data; 5using System.Drawing; 6using System.Text; 7using System.Windows.Forms; 8using System.IO; ... 阅读全文
posted @ 2006-12-27 17:35 tiasys 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 11、使用参数数组 2static int SumVals(params int[] vals) 3{ 4 int sum=0; 5 foreach (int val in vals) 6 { 7 sum +=val; 8 } 9 return sum;10}1112static void Main(string[] args)13{14 int... 阅读全文
posted @ 2006-12-27 17:34 tiasys 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 1 string path = @"c:\temp\MyTest.txt"; 2 try 3 { 4 if (File.Exists(path)) 5 { 6 File.Delete(path); 7 } 8 9 using (Str... 阅读全文
posted @ 2006-12-27 17:34 tiasys 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1 static void Main(string[] args) 2 { 3 ProcessDelegate proc; 4 double par1 = 1.1; 5 double par2 = 2; 6 Console.WriteLine("Enter M or D:"); 7 ... 阅读全文
posted @ 2006-12-27 17:34 tiasys 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1结构是值类型,类是引用类型 2 3 private class mclass 4 { 5 public int val; 6 } 7 8 private struct mstruct 9 {10 public int val;11 }1213 priva... 阅读全文
posted @ 2006-12-27 17:33 tiasys 阅读(2008) 评论(2) 推荐(0) 编辑
摘要: 1 /**//// 2 /// 运算符重载实例 3 /// 4 public class OperatorOverloading 5 { 6 7 public class AddClass1 8 { 9 public int val;1011 /**//// 12 ... 阅读全文
posted @ 2006-12-27 17:32 tiasys 阅读(2231) 评论(0) 推荐(0) 编辑
摘要: 关闭窗口:this.Close(); 退出应用程序: Application.Exit(); DialogResult result;result = MessageBox.Show("你确定要退出么?", "退出", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2); if (re... 阅读全文
posted @ 2006-12-27 17:31 tiasys 阅读(1966) 评论(0) 推荐(0) 编辑
摘要: 1private void textBox2_Validating(object sender, CancelEventArgs e) 2 { 3 if (textBox2.TextLength>0 && (textBox2.TextLength!=5)) 4 { 5 errorProvider1.SetIc... 阅读全文
posted @ 2006-12-27 17:30 tiasys 阅读(3856) 评论(0) 推荐(0) 编辑
摘要: 1Decrypt 方法允许解密使用 Encrypt 方法加密的文件。Decrypt 方法只能解密使用当前用户帐户加密的文件。 2 3Decrypt 方法要求独占访问被解密的文件,如果有其他进程正在使用该文件,此方法将引发异常。如果文件没有加密,则 Decrypt 将返回一个非零值,这表示成功。 4 5Encrypt 方法和 Decrypt 方法都使用计算机上安装的加密服务提供程序 (CSP... 阅读全文
posted @ 2006-12-27 17:29 tiasys 阅读(545) 评论(0) 推荐(0) 编辑
摘要: 1. 使用SQl提供者的,使用SQL SERVER验证方式连接SQL SERVER northwind数据库 @"server=localhost;database=northwind;UID=sa;PassWord="; 2. 使用SQl提供者的,使用windows集成验证方式连接SQL SERVER northwind数据库 @"Data Source=(local);Initial ... 阅读全文
posted @ 2006-12-27 17:27 tiasys 阅读(301) 评论(0) 推荐(0) 编辑