摘要:MessageBox.Show("Environment.CurrentDirectory:"+Environment.CurrentDirectory+"\r\nApplication.ExecutablePath"+Application.ExecutablePath+"\r\nDirectory.GetCurrentDirectory()"+Directory.GetCurrentDirectory()+"\r\nAppDomain.CurrentDomain.BaseDirectory"+AppDomain
阅读全文
摘要:更新程序是比较本地与局域网另一台机上的UpdateList.xml文件中Version差异来更新的.如果Version不一样,会调用更新更新程序检查Files下面各个File的ver如果本地与远程不一样, 或没有则会更新本地的文件.在主程序开始时调一CheckUpdate 一时内打开多次只会提示一次private static void CheckUpdate(){ try { XmlDocument docLocal = new XmlDocument(); XmlDocument docServer = new XmlDocument(); docLocal.Load...
阅读全文
摘要://右击项目->属性->应用程序->程序集信息可以设置版本号//程序集版本stringver=System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();Console.WriteLine("程序集版本:"+ver);//文件版本System.Diagnostics.FileVersionInfomyFileVersionInfo=System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Diagnost
阅读全文
摘要:msn传送exe rar等文件要杀毒软件检测. 自己写个软件修改注册表, 跳过检测usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingMicrosoft.Win32;usingSystem.Runtime.InteropServices;namespaceRegiterMsnAnitVirus{classProgram{staticvoidMain(string[]args){//打开注册表修改msn杀毒软件键值RegistryKeykey=Registry.Users.OpenS
阅读全文
摘要: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
阅读全文
摘要:///<summary>///得到系统时钟周期的当前值///</summary>///<paramname="lpPerformanceCount">输出参数,得到系统时钟周期的当前值</param>///<returns>返回是否获取成功</returns>[DllImport("kernel32.dll",SetLastError=true)]publicstaticexternboolQueryPerformanceCounter(outlonglpPerformanceCou
阅读全文
摘要:可以用: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项目中, 远...
阅读全文
摘要:base.SetStyle(ControlStyles.OptimizedDoubleBuffer,true);privateImageDrawImage(stringstrFilePath){try{Bitmapbitmap=newBitmap(strFilePath);//如果原图片是索引像素格式之列的,则需要转换if(IsPixelFormatIndexed(bitmap.PixelFormat)){Bitmapbmp=newBitmap(bitmap.Width,bitmap.Height,PixelFormat.Format32bppArgb);using(Graphicsg=Gra
阅读全文