常用杂记 一

来源:互联网 发布:毕业证制作软件下载 编辑:程序博客网 时间:2024/06/08 19:31

打开web

syetem.diagnostics.process.stat("http://……);//开启一个进程

获取所在进程id

thread.CurrentThed.ManagedThreadld

递归

重复调用函数自身实现循环。

迭代

函数内部某某段代码实现循环,参与循环的变量同时参与运算。

准确测量时间

StopWatch se=new StopWatch();sw.stat();sw.stop();sw.elapsedMillseconds;sw.restort();

lambda表达式

delegate(string text){return.text.Length};(string text)=>{creturn text.Length};(string text)=>text.length;(text)=>text.Length;text=>text.length;

parallel

并行循环和区域的支持;
用于复杂计算

Linq表达

  • from临时变量 in 实现IEnumerabe < T >接口的集合 where 条件表达式
    [orderdy条件]
    [group by 条件]
    select 临时变量被查询的
  • string ipput=“Hello”;
    int count=input.count(w=>w==”0”);
原创粉丝点击