using System;
using System.Collections.Generic;
using System.Windows.Forms;
using WF_SysApplication;
using AutoUpdater;
using KnightsWarriorAutoupdater;
using System.Net;
using System.Xml;
using System.Diagnostics;
namespace WF.MainMap
{
static class Program
{
///
/// 应用程序的主入口点。
///
[STAThread]
static void Main(string [] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
#region check and download new version program
bool bHasError = false;
try
{
IAutoUpdater autoUpdater = new KnightsWarriorAutoupdater.AutoUpdater(args);
if (autoUpdater.NeedUpdate())
{
Application.Exit();
Process proc = new Process();
proc.StartInfo.UseShellExecute = true;//是否使用操作系统外壳程序启动进程
if (args != null && args.Length > 0)
proc.StartInfo.Arguments = args[0];
proc.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;//启动进程的初始目录
proc.StartInfo.FileName = "KnightsWarrior.exe";
proc.WaitForExit(100);
proc.Start();
return;
}
}
catch (WebException exp)
{
MessageBox.Show("服务器连接失败");
bHasError = true;
}
catch (XmlException exp)
{
bHasError = true;
MessageBox.Show("下载更新文件错误");
}
catch (NotSupportedException exp)
{
bHasError = true;
MessageBox.Show("升级文件配置错误");
}
catch (ArgumentException exp)
{
bHasError = true;
MessageBox.Show("下载升级文件错误");
}
catch (Exception exp)
{
bHasError = true;
MessageBox.Show("更新过程中出现错误");
}
finally
{
// //if (bHasError == true)
// //{
// // try
// // {
// // autoUpdater.RollBack();
// // }
// // catch (Exception)
// // {
// // //Log the message to your file or database
// // }
// //}
// ////OperProcess op = new OperProcess();
// //启动进程
// //op.StartProcess();
}
#endregion
//StaticSystemUIClass.MsgControl.ShowInfoDialog(StaticSystemUIClass.SysConfigXmlControl.SysPath);
if (args == null || args.Length == 0)
{
args = new string[1];
args[0] = "数据管理子系统.wfs";
}
if (args == null || args.Length == 0)
{
MessageBox.Show("未指定子系统类型");
return;
}
DevExpress.UserSkins.BonusSkins.Register();
DevExpress.Skins.SkinManager.EnableFormSkins();
DevExpress.Skins.SkinManager.EnableMdiFormSkins();
Application.Run(new frmMain()); (未将对象引用设置到对象的实例)
}
}
}
还有那个查看详细信息的异常快照怎么看啊?