static void Main(string[] args) { string filename = AppDomain.CurrentDomain.BaseDirectory + "config\\catclient.xml"; Cat.Initialize(filename); WcfServer server = WcfServer.GetInstance(); server.WcfFaultedEvent += new WcfFaulted(server_WcfFaultedEvent); server.WcfClosedEvent += new WcfClosed(server_WcfClosedEvent); server.WcfBeforeCallEvent += new WcfBeforeCall(server_WcfBeforeCallEvent); server.WcfAfterCallEvent += new WcfAfterCall(server_WcfAfterCallEvent); server.Start(); Console.WriteLine("服务启动..."); Console.ReadKey(); server.Stop(); }
protected override void OnStart(string[] args) { server = WcfServer.GetInstance(); server.Start(); }
private void Form1_Load(object sender, EventArgs e) { server = WcfServer.GetInstance(); server.Start(); }