摘要: 有时候考虑到平台之间的通用性,可能把一个Ulong拆分成2个Uint来进行各平台之间的通讯,当时转换的时候有点头晕,对与或预算不是很熟悉,不过还是花了半小时弄出来了,代码: //ulong的最大值2^64 ulong value = (ulong)System.Math.Pow(2, 60) + 23154679912344; byte[] bu = BitConverter.GetBytes(value); //高位 uint high = BitConverter.ToUInt32... 阅读全文
posted @ 2013-08-16 14:51 Go和分布式IM 阅读(1196) 评论(0) 推荐(0) 编辑
摘要: 建立一个空壳文件c#代码: //新建临时文件 using (System.IO.FileStream stream = System.IO.File.Create(this.SaveFileDirctory + @"\" + this.dlFile.SzFileName + this.tempFileExName)) {//临时文件格式:movie.rmvb.td stream.Seek((long)this.dlFile.LFileSize, System.IO.SeekOrigin.Begin)... 阅读全文
posted @ 2013-08-14 20:05 Go和分布式IM 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 代码: /// /// 计算文件的 MD5 值 /// /// 要计算 MD5 值的文件名和路径 /// MD5 值16进制字符串 public static string MD5File(string fileName) { return HashFile(fileName, "md5"); } /// /// 计算文件的哈希值 /// /// 要计算哈希值的文件名和路径 /// 算... 阅读全文
posted @ 2013-08-14 19:36 Go和分布式IM 阅读(396) 评论(0) 推荐(0) 编辑
摘要: /// /// 历史下载记录xml文件操作 /// public class XMLHelper { private string xmlFilePath = ""; /// /// 历史下载记录xml文件操作 /// /// public XMLHelper(string xmlFilePath) { this.xmlFilePa... 阅读全文
posted @ 2013-08-14 16:16 Go和分布式IM 阅读(396) 评论(0) 推荐(0) 编辑
摘要: /// /// 系统控制类,关机,关闭显示器,打开屏幕保存程序等 /// public class SystemPowerController { private const int WM_SYSCOMMAND = 0x112; //系统消息 private const int SC_SCREENSAVE = 0xF140; //启动屏幕保护消息 private const int SC_MONITORPOWER = 0xF170; //关闭显示器的系统命令 private static readon... 阅读全文
posted @ 2013-07-22 17:53 Go和分布式IM 阅读(505) 评论(0) 推荐(0) 编辑
摘要: windows+r 键打开运行输入cmd按回车把下列命令在cmd中点击右键粘贴进去,按回车,即可添加到防火墙例外程序列表中。netsh advfirewall firewall delete rule name="WinClient" dir=in program="C:\Program Files\YView\WinClient.exe" [security=authnoencap action=allow]解释:name="WinClient" 在防火墙中显示的名称 program="C:\Program Files\Y 阅读全文
posted @ 2013-07-02 10:38 Go和分布式IM 阅读(1881) 评论(0) 推荐(0) 编辑
摘要: function AddProcessFwauthor() STRING szCServer,szFServer,szTmp; OBJECT objFirewall, objProfile, objCS, objFS;begin SdShowMsg("将服务器添加到Windows防火墙例外程序中,请稍后...", TRUE); //要添加到防火墙程序的应用程序的完整路径:安装目录\WinClient.exe szCServer = TARGETDIR ^ ("WinClient" + ".exe"); try set obj... 阅读全文
posted @ 2013-07-02 10:21 Go和分布式IM 阅读(564) 评论(0) 推荐(0) 编辑
摘要: 这是开启权限execsp_configure'showadvancedoptions',1reconfigureexecsp_configure'AdHocDistributedQueries',1reconfigure这是代码select*intoTableName TempTable1 fromopenrowset('SQLOLEDB','192.168.0.207';'sa';'P@ssw0rd',[WW_MMS_DB].[dbo].[City])TableName(本地目标表名)City(服 阅读全文
posted @ 2013-06-26 15:00 Go和分布式IM 阅读(183) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { List<string> st = new List<string>(); st.Add("A"); st.Add("B"); //st.Add("C"); bool isF = false; st.ForEach(p => { if (!isF) {... 阅读全文
posted @ 2013-04-19 13:05 Go和分布式IM 阅读(202) 评论(0) 推荐(0) 编辑
摘要: class Program { static void Main(string[] args) { //持有接口的引用 List<speak> lists = new List<speak>(); test te = new test() { user = new user() { name = "sa123", pwd = "123456" } }; lists.Add(te); test te2 = new test() { user = new... 阅读全文
posted @ 2013-04-18 17:11 Go和分布式IM 阅读(169) 评论(0) 推荐(0) 编辑