随笔分类 -  C#

摘要:using HtmlAgilityPack;using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Net;using System.Text;using System.... 阅读全文
posted @ 2015-08-21 13:44 Cvjar 阅读(286) 评论(0) 推荐(0)
摘要:1.is:检查对象类型是否兼容制定类型。返回true,false bool x = a is b;2.as: 效率高于is因为B为父类,子类可以转换为父类,故b不等于空,无输出public class main { public static void Main () ... 阅读全文
posted @ 2015-06-16 12:06 Cvjar 阅读(209) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Linq;using System.IO;using System.Xml.Linq;namespace rooxml{ public class main { ... 阅读全文
posted @ 2015-05-23 21:07 Cvjar 阅读(166) 评论(0) 推荐(0)
摘要:Action : 传递参数,只进不出,所以方法为voidFunc : 传递参数,有进有出,所以传递的方法要returnusing System;using System.Collections.Generic;using System.Linq;namespace rooxml{ public... 阅读全文
posted @ 2015-04-29 11:41 Cvjar 阅读(179) 评论(0) 推荐(0)
摘要:List xx = new List();T x = xx.First(x=>x.x ==x); //寻找对象其中一个匹配值,返回对象xx.Any(x=> x.x == x); //寻找对象其中一个匹配值,返回boolList一次添加多个元素:List li = new List();l... 阅读全文
posted @ 2015-04-28 16:17 Cvjar 阅读(209) 评论(0) 推荐(0)
摘要:队列(Queue):模拟队列的数据操作。例如,排队买票就是一个队列操作,后来的人排在后面,先来的人排在前面,并且买票请求先被处理。为了模拟队列的操作,Queue在ArrayList的基础上加入了以下限制1.元素采用先入先出机制(FIFO,First In First Out),即先进入队列的元素必须... 阅读全文
posted @ 2015-04-28 15:26 Cvjar 阅读(509) 评论(0) 推荐(0)
摘要:1.利用File类,返回带有每一行的string[]数组,强烈推荐使用public partial Form1 : Form{ string[] lines; public Form1() { InitializeComponent(); } ... 阅读全文
posted @ 2015-04-24 11:08 Cvjar 阅读(992) 评论(0) 推荐(0)
摘要:IPAddress[] ips;ips = Dns.GetHostAddresses ("baidu.com");Console.WriteLine (ips[0].ToString()); 阅读全文
posted @ 2015-04-23 16:16 Cvjar 阅读(434) 评论(0) 推荐(0)
摘要:xxx.toString("000") //格式化 阅读全文
posted @ 2015-04-22 10:34 Cvjar 阅读(118) 评论(0) 推荐(0)
摘要:string xxx = ".......";string pat = "{\"userid\":[^}.]*?}"; //校验段 MatchCollection mc = new Regex (pat, RegexOptions.Multiline).Matches (xxx); //去除... 阅读全文
posted @ 2015-04-21 15:59 Cvjar 阅读(131) 评论(0) 推荐(0)
摘要:using System;using System.Collections;using System.Collections.Generic;using System.Linq;using System.Net;using System.Net.Sockets;using System.Text;u... 阅读全文
posted @ 2015-04-21 15:54 Cvjar 阅读(779) 评论(0) 推荐(0)
摘要:Dictionarys;inti=s.Single(x=>x.Value=="xxx").Key;Dictionary dat = new Dictionary ();dat["email"] = "666666@email.com";dat ["pas"] = "1234";//dat.Add (... 阅读全文
posted @ 2015-04-21 15:51 Cvjar 阅读(202) 评论(0) 推荐(0)