谁来讲解下
程序代码:using System;
using System.Collections.Generic;
using System.Text;
using log4net;
namespace DAMSServer
{
class Program
{
static ILog m_Logger = LogManager.GetLogger("Program");
static void Main(string[] args)
{
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
SwitchingServer server = SwitchingServer.Instance;
//System.Threading.Thread.Sleep(30000);
if (server.Init())
{
server.Start();
Console.ReadLine();
server.Stop();
}
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
Exception ex = e.ExceptionObject as Exception;
if (ex != null)
{
m_Logger.Error("UnhandledException " + ex.Message + ex.StackTrace);
}
Environment.Exit(0);
}
}
}






