lougon

导航

文章分类 -  C#

应用程序中向web服务post多文件和post参数
摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> public static string UploadFileEx( string url, System.Web.HttpFileCollection files, ... 阅读全文

posted @ 2008-10-31 15:35 lougon 阅读(621) 评论(0) 推荐(0)

正则表达式。匹配中文字符
摘要:(?[\u4e00-\u9fa5]+) 阅读全文

posted @ 2008-08-27 12:13 lougon 阅读(115) 评论(0) 推荐(0)

复制目录到其他目录
摘要:#region 复制目录到其他目录 public static void CopyDirectory(string sourceDirectoryName, string destinationDirectoryName) { Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(s... 阅读全文

posted @ 2008-07-22 15:24 lougon 阅读(142) 评论(0) 推荐(0)

得到CPUID,硬盘,IP,MAC。。。。。。
摘要:using System; using System.Management; namespace Soyee.Comm { /**//// /// Computer Information /// public class Computer { public string CpuID; public string MacAddress; public string DiskID; public... 阅读全文

posted @ 2008-03-21 12:39 lougon 阅读(590) 评论(0) 推荐(0)

修改config文件
摘要:保存事件#region 保存事件 private void button1_Click(object sender, EventArgs e) { System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(Applicatio... 阅读全文

posted @ 2007-10-23 14:08 lougon 阅读(129) 评论(0) 推荐(0)

serialport串口采集
摘要:using System; using System.IO.Ports; using System.Windows.Forms; namespace SPC { /**//// /// 串口控制 /// public class PortControl { private string _portname; ... 阅读全文

posted @ 2007-09-14 16:55 lougon 阅读(822) 评论(0) 推荐(0)

取出网页的临时文件
摘要:using System;using System.Runtime.InteropServices;namespace post{ /// /// IECache 的摘要说明。 /// public class IECache { public IECache() { // // TODO: ... 阅读全文

posted @ 2007-07-13 12:45 lougon 阅读(1587) 评论(0) 推荐(0)

C#中得到SQL中最新的ID
摘要:InWareID=db.ExecuteScalar("SELECT @@IDENTITY AS NewID").ToString();//得到SQL中最新的ID 阅读全文

posted @ 2006-11-10 11:25 lougon 阅读(199) 评论(0) 推荐(0)

C#用正则表达试一个例子
摘要:private bool JudgmentLetters(string a) { System.Text.RegularExpressions.Regex RegLetters = new Regex("^[A-Z|a-z]{4}$"); System.Text.RegularExpressions.Match m = RegLetters... 阅读全文

posted @ 2006-10-30 11:26 lougon 阅读(369) 评论(0) 推荐(0)

SQL SERVER与C#中数据类型的对应关系
摘要:/**//// /// 数据库中与C#中的数据类型对照 /// /// /// private string ChangeToCSharpType(string type) { string reval=string.Empty; switch(type.ToLower()) { case "int": reval= "Int32"; brea... 阅读全文

posted @ 2006-09-11 17:29 lougon 阅读(183) 评论(0) 推荐(0)

常用正则表达式
摘要:"^\d+$" //非负整数(正整数 + 0) "^[0-9]*[1-9][0-9]*$" //正整数 "^((-\d+)|(0+))$" //非正整数(负整数 + 0) "^-[0-9]*[1-9][0-9]*$" //负整数 "^-?\d+$" //整数 "^\d+(\.\d+)?$" //非负浮点数(正浮点数 + 0) "^(([0-9]+\.[0-9]*[1-9][0-9... 阅读全文

posted @ 2006-09-11 17:10 lougon 阅读(227) 评论(0) 推荐(0)

CheckedListBox进行数据绑定的方法
摘要:今天在使用CheckedListBox控件的时候(Form程序),在数据绑定时遇到了相当大的困难: CheckedListBox控件没有DataSource、ValueMember、DisplayMember成员,无论是在属性窗口还是在代码中都找不到(就是输入“checkedListBoxProj.”后显示的成员列表),怎么办? CheckedListBox是继承ListBox控件的,她的前辈们都... 阅读全文

posted @ 2006-08-02 13:25 lougon 阅读(4044) 评论(10) 推荐(2)

C# 格式化字符串 String.Format
摘要:C# 格式化字符串 String.Format 格式化日期和数字的字符串经常要用到这个, 就把帮助里面的东西大概整理了一些列在这里了. 下表描述了用来格式化 DateTime 对象的标准格式说明符。 格式说明符 名称 说明 d 短日期模式 显示由与当前线程关联的 DateTimeFormatInfo.ShortDatePattern 属性定义的模式或者由指定格式提供程序定义的模式。 D 长日期模式... 阅读全文

posted @ 2006-06-30 16:38 lougon 阅读(266) 评论(0) 推荐(0)

String formatting in C# :玩转string.format
摘要:String formatting in C# I couldn't find a quick reference to .NET string formatting using the String.Format() function, so I created this one. When I started working with the .NET framework, one th... 阅读全文

posted @ 2006-06-30 16:36 lougon 阅读(399) 评论(0) 推荐(0)