|
|
@@ -26,26 +26,26 @@ namespace FileWatcher
|
|
|
Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
|
|
|
//处理非UI线程异常
|
|
|
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
|
|
- //if (!Directory.Exists(AutoAnalysisXml.CachePathFolder))
|
|
|
- // Directory.CreateDirectory(AutoAnalysisXml.CachePathFolder);
|
|
|
- //FileStream fcaches = new FileStream(AutoAnalysisXml.CachePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
|
|
|
- //fcaches.Close();
|
|
|
- //FileInfo info = new FileInfo(AutoAnalysisXml.CachePath);
|
|
|
- //if (info.Length == 0)
|
|
|
- //{
|
|
|
- // XmlDocument doc = new XmlDocument();
|
|
|
- // //创建类型声明节点
|
|
|
- // XmlNode node = doc.CreateXmlDeclaration("1.0", "utf-8", "");
|
|
|
- // doc.AppendChild(node);
|
|
|
- // //创建根节点
|
|
|
- // XmlElement xeRoot = doc.CreateElement("cacheInfo");
|
|
|
- // doc.AppendChild(xeRoot);
|
|
|
- // doc.Save(AutoAnalysisXml.CachePath);
|
|
|
- //}
|
|
|
- //Application.EnableVisualStyles();
|
|
|
- //Application.SetCompatibleTextRenderingDefault(false);
|
|
|
+ if (!Directory.Exists(AutoAnalysisXml.CachePathFolder))
|
|
|
+ Directory.CreateDirectory(AutoAnalysisXml.CachePathFolder);
|
|
|
+ FileStream fcaches = new FileStream(AutoAnalysisXml.CachePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
|
|
|
+ fcaches.Close();
|
|
|
+ FileInfo info = new FileInfo(AutoAnalysisXml.CachePath);
|
|
|
+ if (info.Length == 0)
|
|
|
+ {
|
|
|
+ XmlDocument doc = new XmlDocument();
|
|
|
+ //创建类型声明节点
|
|
|
+ XmlNode node = doc.CreateXmlDeclaration("1.0", "utf-8", "");
|
|
|
+ doc.AppendChild(node);
|
|
|
+ //创建根节点
|
|
|
+ XmlElement xeRoot = doc.CreateElement("cacheInfo");
|
|
|
+ doc.AppendChild(xeRoot);
|
|
|
+ doc.Save(AutoAnalysisXml.CachePath);
|
|
|
+ }
|
|
|
+ Application.EnableVisualStyles();
|
|
|
+ Application.SetCompatibleTextRenderingDefault(false);
|
|
|
if (principal.IsInRole(WindowsBuiltInRole.Administrator))
|
|
|
- Application.Run(new SOP("zhangz","123"));
|
|
|
+ Application.Run(new Login());
|
|
|
else
|
|
|
{
|
|
|
//创建启动对象
|