摘要: 在局域网中非本机的tcp协议的wcf会报如题的错误:套接字连接已中止。这可能是由于处理消息时出错或远程主机超过接收超时或者潜在的网络资源有关问题导致的。本地套接字超时是“00:04:59.9990000”此时可把服务端安全禁用,客户端也需要禁用,这样可以简单的解决问题。另外正确配置安全选项也是可以的 阅读全文
posted @ 2013-02-26 10:52 Tony二师弟 阅读(639) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { System.Security.Cryptography.CspParameters para = new System.Security.Cryptography.CspParameters(); para.KeyContainerName = "g"; para.KeyNumber = 2; System.Security.Cryptography.RSACryptoServiceProvider rs = new Sy... 阅读全文
posted @ 2013-02-22 17:30 Tony二师弟 阅读(520) 评论(0) 推荐(0) 编辑
摘要: static void Main(string[] args) { string mailAddress_from="yftan@chinchool.net"; System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient("smtp.chinool.net", 25); client.Credentials = new System.Net.NetworkCredential(mailAddress_from, ""); ... 阅读全文
posted @ 2013-02-22 17:27 Tony二师弟 阅读(238) 评论(0) 推荐(0) 编辑
摘要: [Microsoft.SqlServer.Server.SqlFunction(DataAccess = Microsoft.SqlServer.Server.DataAccessKind.Read)] public static int GetRadioScore(string StandardAnswer, string StudentAnswer, int ProblemScore, int MRQPartialScore) { using (System.Data.SqlClient.SqlConnection conn = new System.Da... 阅读全文
posted @ 2013-02-22 17:22 Tony二师弟 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 服务端: class Program { static int maxNumberOfServerInstances =10; static void Main(string[] args) { Console.WriteLine("我是服务端"); //创建多个实例,10定义的是表示一个机器上使用同一管道名称的实例最多10个。最大允许254个 for (int i = 0; i < maxNumberOfServerInstances; i++) { ... 阅读全文
posted @ 2013-02-22 16:55 Tony二师弟 阅读(2041) 评论(0) 推荐(0) 编辑
摘要: 我是用三种播放器播放wmv视频,对比了CPU利用率QQ影音 60% 快进时60%~70%迅雷看看 15% 开始时30%WMP 10% 阅读全文
posted @ 2013-02-21 10:35 Tony二师弟 阅读(172) 评论(0) 推荐(0) 编辑
摘要: <object width="100" height="15" title="改变滚动条的值,右边的图片会相应的旋转" id="MyScroll" classid="CLSID:DFD181E0-5E2F-11CE-A449-00AA004A803D"><PARAM NAME="ForeColor" VALUE="2147483666"><PARAM NAME="BackColor" VALUE=" 阅读全文
posted @ 2013-02-21 09:50 Tony二师弟 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 查看msdn或定位到Process类,会看他与内存相关的属性有20个,为了快速找到自己想要的属性,这里进行一下解读:首先要明白几个概念:虚拟内存,分页文件,分页内存,物理内存,工作集,专用内存(私有内存,不能共享的内存)虽然有这么多叫法,但只是叫法不一样。把虚拟内存,分页文件,分页内存都看成虚拟内存就可以了(个人理解)。另外注意几个技巧,第一:Peak是峰值的意思,以Peak开头的属性是使用时的内存量,其他的都是分配的内存;第二:以64结尾的属性返回long类型,否则返回int类型(int类型的属性已经过时);第三:两个返回类型稍微特殊的是MaxWorkingSet和MinWorkingSt, 阅读全文
posted @ 2013-02-05 16:40 Tony二师弟 阅读(5067) 评论(1) 推荐(1) 编辑
摘要: FileSystemWatcher.Changed 事件中又修改文件时 会发生死循环原因是:程序收到文件发生更改的通知后,马上又修改了文件,从而又使文件产生了更改的通知 static void watcher_Changed(object sender, FileSystemEventArgs e) { lock (obj) { File.AppendAllText(@"D:\test\t.txt", "test"); } FileS... 阅读全文
posted @ 2013-01-15 12:46 Tony二师弟 阅读(582) 评论(0) 推荐(0) 编辑
摘要: 遇到如图这样的问题:造成这样的错误原因是:原来的代码: void ModifyFileSecurityInfo(string filename, string username) { System.IO.FileInfo fileInfo = new FileInfo(filename); FileSecurity fs = fileInfo.GetAccessControl(); fs.AddAccessRule(new FileSystemAccessRule(username, FileSystemRi... 阅读全文
posted @ 2012-12-21 09:25 Tony二师弟 阅读(619) 评论(0) 推荐(0) 编辑