private void Start()
{
//打印异常信息
System.AppDomain.CurrentDomain.UnhandledException += new System.UnhandledExceptionEventHandler(UnhandledExceptionEventHandler);
}
static void UnhandledExceptionEventHandler(object sender, System.UnhandledExceptionEventArgs e)
{
try
{
var path = ids.Match3.FileUtils.GetCachedLevelPath() + "UnhandledExceptionEventHandler.log";
using (System.IO.FileStream fs = new System.IO.FileStream(path, System.IO.FileMode.Append, System.IO.FileAccess.Write))
{
using (System.IO.StreamWriter w = new System.IO.StreamWriter(fs, System.Text.Encoding.UTF8))
{
w.WriteLine(e.ExceptionObject);
}
}
}
catch
{
}
}