110,536
社区成员
发帖
与我相关
我的任务
分享
private void DrawCarToMap()
{
while(run)
{
取队列数据;
brower.Document.InvokeScript(gpsData)//执行浏览器的脚本向地图画轨迹
Thread.Sleep(500);
}
}
private void GPS_Event(GPSEventArgs gpsData)
{
压数据到队列
}
private void window_closeing()
{
run = false;
GPS_Event解绑;
try{
DrawMap.Abort();
}catch{}
}
[STAThread]
static void Main(string[] args)
{
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs ex)
{
try
{
Exception e = (Exception)ex.ExceptionObject;
YGApp.Base.Log.IYGAppLog log = YGApp.Base.Log.YGAppLogFactory.GetLog(YGApp.Base.Const.LogTypeEnum.UI);
log.Error("全局未处理异常CurrentDomain_UnhandledException:" + e.Message + "\r\n" + e.Source + "\r\n" + Remis.Common.CommonPublic.GetEntitysString(e.Data), e);
}
catch
{
System.Diagnostics.EventLog.WriteEntry("RemisSetup", ex.ToString(), System.Diagnostics.EventLogEntryType.Error);
}
finally
{
System.Diagnostics.EventLog.WriteEntry("RemisSetup", ex.ToString(), System.Diagnostics.EventLogEntryType.Error);
}
}
/// <summary>
/// 全局线程异常处理事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
try
{
YGApp.Base.Log.IYGAppLog log = YGApp.Base.Log.YGAppLogFactory.GetLog(YGApp.Base.Const.LogTypeEnum.UI);
log.Error("全局未处理异常Application_ThreadException:" + e.Exception.Message + "\r\n" + e.Exception.Source + "\r\n" + Remis.Common.CommonPublic.GetEntitysString(e.Exception.Data), e.Exception);
}
catch
{
System.Diagnostics.EventLog.WriteEntry("RemisSetup", e.ToString(), System.Diagnostics.EventLogEntryType.Error);
}
finally
{
System.Diagnostics.EventLog.WriteEntry("RemisSetup", e.ToString(), System.Diagnostics.EventLogEntryType.Error);
}
}