随笔分类 -  C#

摘要:GUID的使用 前期为了解决订单号唯一问题,在网上找了一些信息,有人建议使用Guid类型来解决。查看MSDN中的叙述如下:Guid 类型表示 16 字节(128 位)GUID 值。此类型映射到 SQL Server 中的 uniqueidentifier 类型。根据这个描述可以得知,Guid在数据库中存储为uniqueidentifier 类型。GUID的唯一值是由计算机网卡的标识数加上一个CPU... 阅读全文
posted @ 2009-11-23 17:55 tiasys 阅读(491) 评论(0) 推荐(0)
摘要:///摘要///程式使用C#.NET 2005 编写///引用类库OPCDAAuto.dll///OPCServer采用KEPWare///在windows xp sp2、sp3、windows 2003上测试通过///完成于:2008年12月31日///测试于:2009年01月05日//////作者:潇洒草///Email:zhkai868@163.com///QQ:44649029/// //... 阅读全文
posted @ 2009-08-30 22:32 tiasys 阅读(4052) 评论(1) 推荐(2)
摘要:由于历史的原因,早期的oracle没有中文字符集(如oracle6、oracle7、oracle7.1),但有的用户从那时起就使用数据库了, 并用US7ASCII字符集存储了中文,或是有的用户在创建数据库时,不考虑清楚,随意选择一个默认的字符集,如WE8ISO8859P1或US7ASCII,而这两个字符集都没有汉字编码,虽然有些时候选用这种字符集好象也能正常使用,但用这种字符集存储汉字信息从原则上... 阅读全文
posted @ 2009-03-20 14:40 tiasys 阅读(1954) 评论(0) 推荐(0)
摘要:一般遇到CHM不能打开,就是要看看文件属性里的安全选项卡中的“解除锁定”设置...但是,今天看到一个说法,就是说如果文件夹名称或者文件名中存在"#"字符,也不能打开.经过试验,发现的确如此! 如果路径是D:\CS3.0Linq入门\ABC.chm,可以好好的打开. 如果改成D:\C#3.0Linq入门\ABC.chm,则会显示"This program cannot display the web... 阅读全文
posted @ 2009-01-08 11:40 tiasys 阅读(678) 评论(0) 推荐(0)
摘要:SQL Server ODBC Standard Security: "Driver={SQL Server};Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;" Trusted connec... 阅读全文
posted @ 2008-07-23 18:23 tiasys 阅读(274) 评论(0) 推荐(0)
摘要:Microsoft .NET 下透過 ADO .NET Managed Provider 存取 Oracle 是很常見之需求,但無論是 Oralce 提供之 Oracle Data Provider for .NET (ODP) 或是微軟所提供之 ADO.NET Manged Provider for Oracle 在中文環境下都有著相同的限制,就是 Oralce NLS_LANG 的設定必須 S... 阅读全文
posted @ 2008-07-23 18:00 tiasys 阅读(914) 评论(0) 推荐(0)
摘要:DropDownList1.Items.Clear(); foreach (string s in Enum.GetNames(typeof(Chart2DTypeEnum))) { DropDownList1.Items.Add(s); } 阅读全文
posted @ 2008-07-02 17:46 tiasys 阅读(901) 评论(0) 推荐(0)
摘要:将RichTextBox的内容直接写入数据库: private void button1_Click(object sender, EventArgs e) { System.IO.MemoryStream mstream = new System.IO.MemoryStream(); this.richTextBox1.SaveFile(mstream, RichTextBoxStr... 阅读全文
posted @ 2008-07-01 09:12 tiasys 阅读(684) 评论(2) 推荐(0)
摘要:同属于一个应用程序的好多窗口,要想限定一个窗口只打开一次,如果打开的话就激活,使用下面的代码 1 private void button1_Click(object sender, EventArgs e) 2 { 3 bool isfind = false; 4 foreach (Form fm in Applicatio... 阅读全文
posted @ 2008-04-15 22:15 tiasys 阅读(1336) 评论(0) 推荐(0)
摘要:Windows服务是独立于登录用户而工作的Windows应用程序,它通常在计算机启动时开始执行,且常常连续执行,直到计算机关闭为止。像Exchange Server,IIS和杀毒软件等都使用这种方式,这样就可以独立于某一用户而且可以在任何用户登录前来运行,同时也可以服务于所有的进程,从而以一种服务的形式存在。 正因为Windows服务有着这么多的特性,因此,当需要一些特殊功能的时候就可以考... 阅读全文
posted @ 2008-04-15 16:25 tiasys 阅读(2010) 评论(0) 推荐(0)
摘要:转义序列 产生的字符 字符的Unicode值 \' 单引号 0x0027 \" ... 阅读全文
posted @ 2006-12-27 17:41 tiasys 阅读(627) 评论(0) 推荐(0)
摘要:1//----------------------------------------------- 2父窗口代码 3 4//----------------------------------------------- 5 public Main() 6 { 7 InitializeComponent(); 8 //启用Windows ... 阅读全文
posted @ 2006-12-27 17:40 tiasys 阅读(529) 评论(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 阅读(2318) 评论(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 阅读(274) 评论(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 阅读(333) 评论(0) 推荐(0)
摘要:1件运算符 (?:) 根据布尔型表达式的值返回两个值中的一个。条件运算符的格式如下 2 3 复制代码 4condition ? first_expression : second_expression; 5 6 7备注 8如果条件为 true,则计算第一表达式并以它的计算结果为准;如果为 false,则计算第二表达式并以它的计算结果为准。只计算两个表达式中的一个。 910使用条件运算符,... 阅读全文
posted @ 2006-12-27 17:36 tiasys 阅读(570) 评论(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 阅读(446) 评论(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 阅读(250) 评论(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 阅读(240) 评论(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 阅读(225) 评论(0) 推荐(0)