悉野小楼

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

统计

12 2011 档案

获取程序当前文件夹 c#
摘要:MessageBox.Show("Environment.CurrentDirectory:"+Environment.CurrentDirectory+"\r\nApplication.ExecutablePath"+Application.ExecutablePath+"\r\nDirectory.GetCurrentDirectory()"+Directory.GetCurrentDirectory()+"\r\nAppDomain.CurrentDomain.BaseDirectory"+AppDomain 阅读全文

posted @ 2011-12-21 15:51 悉野 阅读(311) 评论(1) 推荐(0) 编辑

桌面程序自动更新程序(C# )
摘要:更新程序是比较本地与局域网另一台机上的UpdateList.xml文件中Version差异来更新的.如果Version不一样,会调用更新更新程序检查Files下面各个File的ver如果本地与远程不一样, 或没有则会更新本地的文件.在主程序开始时调一CheckUpdate 一时内打开多次只会提示一次private static void CheckUpdate(){ try { XmlDocument docLocal = new XmlDocument(); XmlDocument docServer = new XmlDocument(); docLocal.Load... 阅读全文

posted @ 2011-12-20 13:26 悉野 阅读(899) 评论(0) 推荐(0) 编辑

C# 文件版本信息读取
摘要://右击项目->属性->应用程序->程序集信息可以设置版本号//程序集版本stringver=System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();Console.WriteLine("程序集版本:"+ver);//文件版本System.Diagnostics.FileVersionInfomyFileVersionInfo=System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Diagnost 阅读全文

posted @ 2011-12-20 10:38 悉野 阅读(2093) 评论(0) 推荐(0) 编辑

C#读写注册表 二进制写入
摘要: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 阅读全文

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

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 悉野 阅读(979) 评论(0) 推荐(0) 编辑

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

posted @ 2011-12-08 16:38 悉野 阅读(346) 评论(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 悉野 阅读(3945) 评论(0) 推荐(0) 编辑

winform双缓冲, 从内存画图到到picturebox
摘要: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 阅读全文

posted @ 2011-12-05 16:24 悉野 阅读(2656) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示