随笔分类 -  c#

上一页 1 ··· 4 5 6 7 8 9 10 11 下一页
摘要://测试字符串 左包含 //string str = "AAABBBCCC"; //char[] ss = str.ToArray(); //0-8 字符数组 //char[] ss1 = str.ToCharArray();//0-8 字符数组 //给定一个字符串 AAA ... 阅读全文
posted @ 2018-07-19 09:50 enych 阅读(766) 评论(0) 推荐(0)
摘要:C# 统计字符串出现的次数 阅读全文
posted @ 2018-07-18 15:39 enych 阅读(233) 评论(0) 推荐(0)
摘要:string str0 = ""; string str1 = " "; var ss0 = str0.All(char.IsDigit); //true//识别空字符时候 会认为是数字 var ss1 = str1.All(char.IsDigit); //false//识别空字符时候 会认为是数 阅读全文
posted @ 2018-07-18 12:15 enych 阅读(1711) 评论(0) 推荐(0)
摘要:IEnumerable<Attribute> keys = p.GetCustomAttributes().ToList(); var data1 = data.Where(n => n.Name.Contains(search)).ToList(); if (data1.Count == 0) / 阅读全文
posted @ 2018-07-17 10:45 enych 阅读(3823) 评论(0) 推荐(0)
摘要:IPagedList ss = Doclist.ToPagedList(page, pageSize); for (int i=0;i<ss.Count;i++) { var yy = ss[i]; } 阅读全文
posted @ 2018-07-17 08:48 enych 阅读(742) 评论(0) 推荐(0)
摘要:private void button1_Click(object sender, EventArgs e) { textBox2.Text = ""; string str = ""; foreach (string s2 in textBox1.Lines) { ... 阅读全文
posted @ 2018-07-11 17:43 enych 阅读(416) 评论(0) 推荐(0)
摘要:1. //重命名文件 // 改名方法 FileInfo fi = new FileInfo("旧路径"); //xx/xx/aa.rar fi.MoveTo("新路径"); //xx/xx/xx.rar ... 阅读全文
posted @ 2018-07-05 15:38 enych 阅读(29604) 评论(0) 推荐(4)
摘要://把一个单独的对象 转换为json字符串 阅读全文
posted @ 2018-07-02 12:04 enych 阅读(269) 评论(0) 推荐(0)
摘要:#region --基础 ////设置目录树 ////添加根节点 //treeView1.Nodes.Add("0000000"); ////添加子节点 ////treeView1.SelectedNode.Nodes.Add("11111111"); ... 阅读全文
posted @ 2018-07-01 16:30 enych 阅读(238) 评论(0) 推荐(0)
摘要:非递归绑定3级别 阅读全文
posted @ 2018-07-01 16:03 enych 阅读(834) 评论(0) 推荐(0)
摘要:this.dataGridView1.Columns.Add("0","001");//添加列 this.dataGridView1.Columns.Add("0", "002"); this.dataGridView1.Columns.Add("0", "003"); this.dataGridV 阅读全文
posted @ 2018-06-30 11:32 enych 阅读(2826) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-06-29 17:26 enych 阅读(130) 评论(0) 推荐(0)
摘要:private void button1_Click(object sender, EventArgs e) { //转换 string str1 = "表达式1?表达式2:表达式3"; str1.IndexOf('?'); //查找第一个?所在位置 StringBuilder... 阅读全文
posted @ 2018-06-04 23:30 enych 阅读(481) 评论(0) 推荐(0)
摘要:foreach (System.Reflection.PropertyInfo p in users.GetType().GetProperties()) { var xx = p.Name; var yy = p.GetValue(users); } Type type = typeof(pof) 阅读全文
posted @ 2018-05-31 10:21 enych 阅读(4649) 评论(0) 推荐(0)
摘要:地址1 https://blog.csdn.net/zhuoyue008/article/details/53323278 地址2 https://www.cnblogs.com/sydeveloper/archive/2013/02/25/2932571.html vbs Set wshobj=W 阅读全文
posted @ 2018-05-04 11:59 enych 阅读(280) 评论(0) 推荐(0)
摘要://创建ManagementObjectSearcher对象 ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia"); String strHardDiskID = null;/... 阅读全文
posted @ 2018-05-02 14:16 enych 阅读(8871) 评论(1) 推荐(0)
摘要:private void Form1_Load(object sender, EventArgs e) { Process[] processes = Process.GetProcesses();//获取所有进程信息 for (int i = 0; i < processes.Length; i++) {... 阅读全文
posted @ 2018-05-02 10:21 enych 阅读(360) 评论(0) 推荐(0)
摘要:public int GetWindowsServiceStartType(String sServiceName) //判断服务状态是手动还是禁用还是自动 { string sState = ""; try { System.Diagnostics.Proc... 阅读全文
posted @ 2018-04-25 17:21 enych 阅读(251) 评论(0) 推荐(0)
摘要:private void button1_Click(object sender, EventArgs e) { string info = ""; string info1 = ""; RegistryKey Key; Key = Registry.LocalMachine; /... 阅读全文
posted @ 2018-04-25 16:53 enych 阅读(147) 评论(0) 推荐(0)
摘要:1.在 Global.asax 2.在App_Start/RouteConfig.cs 阅读全文
posted @ 2018-04-20 11:05 enych 阅读(224) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 下一页