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

浙公网安备 33010602011771号