悉野小楼

导航

2011年12月8日

C# .net Remoting最简单的例子

摘要: C# .netRemoting最简单的例子C# Remoting例子下载服务端:usingSystem;usingSystem.Runtime.InteropServices;usingSystem.Runtime.Remoting.Channels.Tcp;usingSystem.Runtime.Remoting.Channels;usingSystem.Runtime.Remoting;//在引用中添加namespaceRemotingTest{classProgram{staticvoidMain(string[]args){try{TcpServerChannelserver=newT 阅读全文

posted @ 2011-12-08 17:46 悉野 阅读(969) 评论(0) 推荐(0) 编辑

输出函数调用时间 多少毫秒(转)

摘要: ///<summary>///得到系统时钟周期的当前值///</summary>///<paramname="lpPerformanceCount">输出参数,得到系统时钟周期的当前值</param>///<returns>返回是否获取成功</returns>[DllImport("kernel32.dll",SetLastError=true)]publicstaticexternboolQueryPerformanceCounter(outlonglpPerformanceCou 阅读全文

posted @ 2011-12-08 16:38 悉野 阅读(342) 评论(0) 推荐(0) 编辑

C# 16进制字符串转成整数

摘要: 可以用:Convert.ToInt32(str, 16)如果全小写, 可以用:int[] b = new int[str.Length];Array.Clear(b, 0, str.Length); //初始化for(int j = 0; j < str.Length; ++j){ if (b[j] >= 97) b[j] = b[j] - 87; else b[j] = b[j] - 48;}在大量字符串转换时, 下面那个转换效率会高很多.在大量循环中尽量少用new 关键字, 少用.net自带的封装类.今天在一个remoting项目中, 远... 阅读全文

posted @ 2011-12-08 16:09 悉野 阅读(3916) 评论(0) 推荐(0) 编辑