摘要:Code Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> public static string UploadFileEx( string url, System.Web.HttpFileCollection files, ...
阅读全文
摘要:#region 复制目录到其他目录 public static void CopyDirectory(string sourceDirectoryName, string destinationDirectoryName) { Microsoft.VisualBasic.FileIO.FileSystem.CopyDirectory(s...
阅读全文
摘要:using System; using System.Management; namespace Soyee.Comm { /**//// /// Computer Information /// public class Computer { public string CpuID; public string MacAddress; public string DiskID; public...
阅读全文
摘要:保存事件#region 保存事件 private void button1_Click(object sender, EventArgs e) { System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(Applicatio...
阅读全文
摘要:using System; using System.IO.Ports; using System.Windows.Forms; namespace SPC { /**//// /// 串口控制 /// public class PortControl { private string _portname; ...
阅读全文
摘要:using System;using System.Runtime.InteropServices;namespace post{ /// /// IECache 的摘要说明。 /// public class IECache { public IECache() { // // TODO: ...
阅读全文
摘要:InWareID=db.ExecuteScalar("SELECT @@IDENTITY AS NewID").ToString();//得到SQL中最新的ID
阅读全文
摘要:private bool JudgmentLetters(string a) { System.Text.RegularExpressions.Regex RegLetters = new Regex("^[A-Z|a-z]{4}$"); System.Text.RegularExpressions.Match m = RegLetters...
阅读全文
摘要:/**//// /// 数据库中与C#中的数据类型对照 /// /// /// private string ChangeToCSharpType(string type) { string reval=string.Empty; switch(type.ToLower()) { case "int": reval= "Int32"; brea...
阅读全文
摘要:"^\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...
阅读全文
摘要:今天在使用CheckedListBox控件的时候(Form程序),在数据绑定时遇到了相当大的困难: CheckedListBox控件没有DataSource、ValueMember、DisplayMember成员,无论是在属性窗口还是在代码中都找不到(就是输入“checkedListBoxProj.”后显示的成员列表),怎么办? CheckedListBox是继承ListBox控件的,她的前辈们都...
阅读全文
摘要:C# 格式化字符串 String.Format 格式化日期和数字的字符串经常要用到这个, 就把帮助里面的东西大概整理了一些列在这里了. 下表描述了用来格式化 DateTime 对象的标准格式说明符。 格式说明符 名称 说明 d 短日期模式 显示由与当前线程关联的 DateTimeFormatInfo.ShortDatePattern 属性定义的模式或者由指定格式提供程序定义的模式。 D 长日期模式...
阅读全文
摘要: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...
阅读全文