摘要: using System.Net; Dns.GetHostName()//获取本机电脑名 string sql = "select GETDATE()";获取服务器时间 阅读全文
posted @ 2020-01-04 08:09 zhujie- 阅读(272) 评论(0) 推荐(0) 编辑
摘要: using System; using System.Collections.Generic; using System.Linq; using System.Text; using DocumentFormat.OpenXml.Packaging;//必须 using S = DocumentFo 阅读全文
posted @ 2019-12-25 07:20 zhujie- 阅读(493) 评论(0) 推荐(0) 编辑
摘要: //====Regex.Match只能提取第一个匹配字符串 static void Main() { string str = "zh12jie56中国"; Match match = Regex.Match(str, "\\d+"); Console.WriteLine(match.Value); 阅读全文
posted @ 2019-12-25 07:12 zhujie- 阅读(204) 评论(0) 推荐(0) 编辑
摘要: rivate void comboBox1_TextUpdate(object sender, EventArgs e)//TextUpdate事件 { string[] data = new string[] { "张三", "李四", "王五", "赵六", "田七","张三丰","铁拐李"," 阅读全文
posted @ 2019-12-25 07:06 zhujie- 阅读(789) 评论(0) 推荐(0) 编辑
摘要: 配置文件 不带密码 带密码 public static class Access { public static readonly string connstr = ConfigurationManager.AppSettings["connstr"].ToString(); public stat 阅读全文
posted @ 2019-12-21 07:17 zhujie- 阅读(334) 评论(0) 推荐(0) 编辑
摘要: // 设定 (1, 2) 为当前单元格 DataGridView1.CurrentCell = DataGridView1[1, 2]; // 取得当前单元格内容 MessageBox.Show(DataGridView1.CurrentCell.Value.ToString()); // 取得当前 阅读全文
posted @ 2019-12-19 07:16 zhujie- 阅读(1048) 评论(0) 推荐(0) 编辑
摘要: C form窗体常用属性 (1)Name属性:用来获取或设置窗体的名称。 (2)WindowState属性:用来获取或设置窗体的窗口状态。 (3)StartPosition属性:用来获取或设置运行时窗体的起始位置。CenterScreen (居中显示) (4)Text属性:该属性是一个字符串属性,用 阅读全文
posted @ 2019-12-19 07:13 zhujie- 阅读(1926) 评论(0) 推荐(1) 编辑
摘要: //写在dataGridView1控件的CellPainting事件中 if (e.ColumnIndex==0 && e.RowIndex!= 1 || e.ColumnIndex==1 && e.RowIndex!= 1)//对第1列和第2列相同单元格进行合并 { Brush datagridB 阅读全文
posted @ 2019-12-19 07:11 zhujie- 阅读(701) 评论(0) 推荐(0) 编辑
摘要: //单击命令按钮触发此事件 private void button1_Click(object sender, EventArgs e) { OpenFileDialog fd = new OpenFileDialog();//首先根据打开文件对话框,选择excel表格 fd.Filter = "表 阅读全文
posted @ 2019-12-19 07:10 zhujie- 阅读(473) 评论(0) 推荐(0) 编辑
摘要: //先添加引用,步骤:1,引用 COM Microsoft Excel 14.0 Object Library //14.0是2010版 // 2,using Excel = Microsoft.Office.Interop.Excel; //// 3,using Microsoft.Office. 阅读全文
posted @ 2019-12-19 07:08 zhujie- 阅读(638) 评论(0) 推荐(0) 编辑