12 2011 档案
摘要:以下实现的目标是:localhost:6677/Services/Chinalocalhost:6677/Services/USAlocalhost:6677/Services/...以上所有调用都走到Service方法中,因为支持的国家是未知的,不能写成方法,并且请求的schame已经确定,不能再做修改,所以就有了以下实现:定义Service Interface,包含一个方法Service.代码 比较简单,只是重写OperationSelector属性,返回所有请求到方法"Service"(大小区分)public class RouteBehaviorExtension
阅读全文
摘要:在windows services开发中,碰到一个奇怪的问题:有时可以启动,有时启动超时,经过漫长的分析(有引用其它的组件),发现问题出在Performance counter的创建上,sometimes, the code will be hang here.Link:http://www.pcreview.co.uk/forums/strange-performance-counter-performance-problem-windows-service-application-t2781664.html解决方法:将Performance Counter操作放到OnStart方法中,不要
阅读全文
摘要:private void InternalWriteEvent(uint eventID, ushort category, EventLogEntryType type, string[] strings, byte[] rawData, string currentMachineName);Declaring Type:System.Diagnostics.EventLogInternalAssembly:System, Version=4.0.0.0private void InternalWriteEvent(uint eventID, ushort category, EventLo
阅读全文

浙公网安备 33010602011771号