随笔分类 - C#
摘要:privatebool IsAllNumber(string text) { Regex objNotNumberPattern =new Regex("[^0-9.-]"); Regex objTwoDotPattern =new Regex("[0-9]*[.][0-9]*[.][0-9]*"); Regex objTwoMinusPattern =new Regex("[0-9]*[-][0-9]*[-][0-9]*"); String strValidRealPattern ="^([-]|[.]|[-.]|[0-9
阅读全文
摘要:C#复制文件到指定文件夹2010-06-04 16:09如: 路径:“D:/a/b” 有如下文件 P1009.txt Z1009.txt T1009.txt 复制到 E:盘下,自动建立一个以日期为文件夹名的文件夹下。可以使用Process,用它打开CMD,然后执行DOS命令!(可以设置不打开CMD窗口) 《1》System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName= "cmd.exe "; p.StartInfo.UseShellExecute=false;
阅读全文
摘要:C#实现打印功能具体的操作步骤如下: 创建一个PrintDialog的实例。如下: System.Windows.Forms.PrintDialog PrintDialog1=new PrintDialog (); 创建一个PrintDocument的实例.如下: System.Drawing.Printing.PrintDocument docToPrint = new System.Drawing.Printing.PrintDocument(); 设置打印机开始打印的事件处理函数.函数原形如下: void docToPrint_PrintPage(object se...
阅读全文
摘要:/// <summary> /// 数据库中与C#中的数据类型对照/// </summary> /// <param name="type"></param> /// <returns></returns> private string ChangeToCSharpType(string type) { string reval=string.Empty; switch(type.ToLower()) { case "int": reval= "Int32"; b
阅读全文
摘要:http://www.cnblogs.com/jxsoft/archive/2011/05/06/2038952.html) 行、列的隐藏 [VB.NET] ' DataGridView1的第一列隐藏 DataGridView1.Columns(0).Visible = False ' DataGridView1的第一行隐藏 DataGridView1.Rows(0).Visible = False[C#] // DataGridView1的第一列隐藏 DataGridView1.Columns[0].Visible = false; // DataGridView1的第一行隐
阅读全文
摘要:private void button1_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() != DialogResult.Cancel) { FileName = openFileDialog1.FileName; System.IO.StreamReader readfile = new System.IO.StreamReader(FileName); ...
阅读全文

浙公网安备 33010602011771号