Browse Source

测试Log工具抓取

callm 2 years ago
parent
commit
22b7e10b49

+ 1 - 1
FileWatcher/AutoAnalysisXml.Designer.cs

@@ -252,7 +252,7 @@
             this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.MaximizeBox = false;
             this.Name = "AutoAnalysisXml";
-            this.Text = "UAS自动过站解析器 2022-05-20  15:05";
+            this.Text = "UAS自动过站解析器 2022-07-20  15:05";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
             this.Load += new System.EventHandler(this.Form1_Load);
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();

+ 5 - 13
FileWatcher/AutoAnalysisXml.cs

@@ -58,6 +58,8 @@ namespace FileWatcher
         /// </summary>
         List<string> _FileName = new List<string>();
 
+        string master;
+
         ftpOperater ftp = new ftpOperater();
 
         public AutoAnalysisXml()
@@ -67,12 +69,13 @@ namespace FileWatcher
             StartPosition = FormStartPosition.CenterScreen;
         }
 
-        public AutoAnalysisXml(string iUserName, string iSource)
+        public AutoAnalysisXml(string iUserName, string iSource,string iMaster)
         {
             tipform = new Tip();
             InitializeComponent();
             iusercode = iUserName;
             isource = iSource.ToUpper();
+            master = iMaster;
             StartPosition = FormStartPosition.CenterScreen;
         }
 
@@ -88,10 +91,6 @@ namespace FileWatcher
             stw.StartPosition = FormStartPosition.CenterScreen;
             stw.ShowDialog();
             List<string> CacheInf = new List<string>();
-            DB = (DataTable)dh.ExecuteSql("select ms_pwd,ma_user,ma_address,ma_inneraddress from master where ma_user='MES'", "select");
-            Master.DataSource = DB;
-            Master.DisplayMember = "ma_user";
-            Master.ValueMember = "ma_user";
             //获取缓存信息
             try
             {
@@ -101,14 +100,6 @@ namespace FileWatcher
                 //AutoStart.Checked = (bool)BaseUtil.GetCacheData("AutoStart");
             }
             catch (Exception ex) { MessageBox.Show(ex.Message); }
-            for (int i = 0; i < DB.Rows.Count; i++)
-            {
-                if (Master.Text == DB.Rows[i]["ma_user"].ToString())
-                {
-                    DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DGW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-                    dh = new DataHelper();
-                }
-            }
             //获取岗位资源相关信息
             DataTable dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode,st_badgroupcode from source left join step on sc_stepcode=st_code where sc_code='" + isource + "'", "select");
             if (dt.Rows.Count > 0)
@@ -121,6 +112,7 @@ namespace FileWatcher
 
         private void ConnectDB()
         {
+            DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=" + master + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             dh = new DataHelper();
         }
 

+ 286 - 0
FileWatcher/AutoAnalysisXmlByStep.Designer.cs

@@ -0,0 +1,286 @@
+namespace FileWatcher
+{
+    partial class AutoAnalysisXmlByStep
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.components = new System.ComponentModel.Container();
+            this.XmlWatcher = new System.IO.FileSystemWatcher();
+            this.XmlFolder = new System.Windows.Forms.FolderBrowserDialog();
+            this.StartWatch = new System.Windows.Forms.Button();
+            this.StopWatch = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.FolderPath = new System.Windows.Forms.TextBox();
+            this.ChooseFolder = new System.Windows.Forms.Button();
+            this.OperateResult = new System.Windows.Forms.RichTextBox();
+            this.Clean = new System.Windows.Forms.Button();
+            this.MakeCode_lable = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.Master = new System.Windows.Forms.ComboBox();
+            this.AutoStart = new System.Windows.Forms.CheckBox();
+            this.ma_code = new System.Windows.Forms.TextBox();
+            this.BatchAnalysus = new System.Windows.Forms.Button();
+            this.Timer = new System.Windows.Forms.Timer(this.components);
+            this.Device = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // XmlWatcher
+            // 
+            this.XmlWatcher.EnableRaisingEvents = true;
+            this.XmlWatcher.Filter = "*.xml";
+            this.XmlWatcher.SynchronizingObject = this;
+            // 
+            // StartWatch
+            // 
+            this.StartWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.StartWatch.Location = new System.Drawing.Point(290, 557);
+            this.StartWatch.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.StartWatch.Name = "StartWatch";
+            this.StartWatch.Size = new System.Drawing.Size(128, 56);
+            this.StartWatch.TabIndex = 0;
+            this.StartWatch.Text = "开始监控";
+            this.StartWatch.UseVisualStyleBackColor = true;
+            this.StartWatch.Click += new System.EventHandler(this.StartWatch_Click);
+            // 
+            // StopWatch
+            // 
+            this.StopWatch.Enabled = false;
+            this.StopWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.StopWatch.Location = new System.Drawing.Point(498, 557);
+            this.StopWatch.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.StopWatch.Name = "StopWatch";
+            this.StopWatch.Size = new System.Drawing.Size(128, 56);
+            this.StopWatch.TabIndex = 1;
+            this.StopWatch.Text = "停止监控";
+            this.StopWatch.UseVisualStyleBackColor = true;
+            this.StopWatch.Click += new System.EventHandler(this.StopWatch_Click);
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(48, 400);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(162, 38);
+            this.label1.TabIndex = 2;
+            this.label1.Text = "监控文件夹";
+            // 
+            // FolderPath
+            // 
+            this.FolderPath.Enabled = false;
+            this.FolderPath.Location = new System.Drawing.Point(218, 400);
+            this.FolderPath.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.FolderPath.Name = "FolderPath";
+            this.FolderPath.Size = new System.Drawing.Size(436, 35);
+            this.FolderPath.TabIndex = 3;
+            // 
+            // ChooseFolder
+            // 
+            this.ChooseFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ChooseFolder.Location = new System.Drawing.Point(686, 394);
+            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.ChooseFolder.Name = "ChooseFolder";
+            this.ChooseFolder.Size = new System.Drawing.Size(156, 48);
+            this.ChooseFolder.TabIndex = 6;
+            this.ChooseFolder.Text = "选择文件夹";
+            this.ChooseFolder.UseVisualStyleBackColor = true;
+            this.ChooseFolder.Click += new System.EventHandler(this.ChooseFolder_Click);
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Location = new System.Drawing.Point(892, 22);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(517, 535);
+            this.OperateResult.TabIndex = 7;
+            this.OperateResult.Text = "";
+            // 
+            // Clean
+            // 
+            this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Clean.Location = new System.Drawing.Point(1096, 580);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Clean.Name = "Clean";
+            this.Clean.Size = new System.Drawing.Size(112, 48);
+            this.Clean.TabIndex = 8;
+            this.Clean.Text = "清除";
+            this.Clean.UseVisualStyleBackColor = true;
+            this.Clean.Click += new System.EventHandler(this.Clean_Click);
+            // 
+            // MakeCode_lable
+            // 
+            this.MakeCode_lable.AutoSize = true;
+            this.MakeCode_lable.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.MakeCode_lable.Location = new System.Drawing.Point(48, 311);
+            this.MakeCode_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.MakeCode_lable.Name = "MakeCode_lable";
+            this.MakeCode_lable.Size = new System.Drawing.Size(104, 38);
+            this.MakeCode_lable.TabIndex = 12;
+            this.MakeCode_lable.Text = "工单号";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(54, 46);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(133, 38);
+            this.label4.TabIndex = 14;
+            this.label4.Text = "账套选择";
+            this.label4.Visible = false;
+            // 
+            // Master
+            // 
+            this.Master.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.Master.FormattingEnabled = true;
+            this.Master.Location = new System.Drawing.Point(224, 46);
+            this.Master.Margin = new System.Windows.Forms.Padding(6);
+            this.Master.Name = "Master";
+            this.Master.Size = new System.Drawing.Size(436, 32);
+            this.Master.TabIndex = 15;
+            // 
+            // AutoStart
+            // 
+            this.AutoStart.AutoSize = true;
+            this.AutoStart.Location = new System.Drawing.Point(686, 51);
+            this.AutoStart.Margin = new System.Windows.Forms.Padding(6);
+            this.AutoStart.Name = "AutoStart";
+            this.AutoStart.Size = new System.Drawing.Size(186, 28);
+            this.AutoStart.TabIndex = 16;
+            this.AutoStart.Text = "开机自动启动";
+            this.AutoStart.UseVisualStyleBackColor = true;
+            this.AutoStart.Visible = false;
+            this.AutoStart.CheckedChanged += new System.EventHandler(this.AutoStart_CheckedChanged);
+            // 
+            // ma_code
+            // 
+            this.ma_code.Location = new System.Drawing.Point(218, 311);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Size = new System.Drawing.Size(436, 35);
+            this.ma_code.TabIndex = 17;
+            // 
+            // BatchAnalysus
+            // 
+            this.BatchAnalysus.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.BatchAnalysus.Location = new System.Drawing.Point(686, 308);
+            this.BatchAnalysus.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.BatchAnalysus.Name = "BatchAnalysus";
+            this.BatchAnalysus.Size = new System.Drawing.Size(156, 48);
+            this.BatchAnalysus.TabIndex = 18;
+            this.BatchAnalysus.Text = "批量解析";
+            this.BatchAnalysus.UseVisualStyleBackColor = true;
+            this.BatchAnalysus.Click += new System.EventHandler(this.BatchAnalysus_Click);
+            // 
+            // Timer
+            // 
+            this.Timer.Interval = 10000;
+            this.Timer.Tick += new System.EventHandler(this.Timer_Tick);
+            // 
+            // Device
+            // 
+            this.Device.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.Device.FormattingEnabled = true;
+            this.Device.Items.AddRange(new object[] {
+            "AOI设备",
+            "测试设备"});
+            this.Device.Location = new System.Drawing.Point(218, 222);
+            this.Device.Margin = new System.Windows.Forms.Padding(6);
+            this.Device.Name = "Device";
+            this.Device.Size = new System.Drawing.Size(436, 32);
+            this.Device.TabIndex = 20;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(48, 222);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(133, 38);
+            this.label3.TabIndex = 19;
+            this.label3.Text = "设备选择";
+            // 
+            // AutoAnalysisXml
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1443, 640);
+            this.Controls.Add(this.Device);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.BatchAnalysus);
+            this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.AutoStart);
+            this.Controls.Add(this.Master);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.MakeCode_lable);
+            this.Controls.Add(this.Clean);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.ChooseFolder);
+            this.Controls.Add(this.FolderPath);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.StopWatch);
+            this.Controls.Add(this.StartWatch);
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.MaximizeBox = false;
+            this.Name = "AutoAnalysisXml";
+            this.Text = "UAS自动过站解析器 2022-07-20  15:05";
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
+            this.Load += new System.EventHandler(this.Form1_Load);
+            ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.IO.FileSystemWatcher XmlWatcher;
+        private System.Windows.Forms.FolderBrowserDialog XmlFolder;
+        private System.Windows.Forms.Button StopWatch;
+        private System.Windows.Forms.Button StartWatch;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.TextBox FolderPath;
+        private System.Windows.Forms.Button ChooseFolder;
+        private System.Windows.Forms.RichTextBox OperateResult;
+        private System.Windows.Forms.Button Clean;
+        private System.Windows.Forms.Label MakeCode_lable;
+        private System.Windows.Forms.ComboBox Master;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.CheckBox AutoStart;
+        private System.Windows.Forms.TextBox ma_code;
+        private System.Windows.Forms.Button BatchAnalysus;
+        private System.Windows.Forms.Timer Timer;
+        private System.Windows.Forms.ComboBox Device;
+        private System.Windows.Forms.Label label3;
+    }
+}
+

+ 717 - 0
FileWatcher/AutoAnalysisXmlByStep.cs

@@ -0,0 +1,717 @@
+using Microsoft.Win32;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.IO;
+using System.Threading;
+using System.Windows.Forms;
+using System.Xml;
+using System.Text;
+using System.Media;
+
+namespace FileWatcher
+{
+    public partial class AutoAnalysisXmlByStep : Form
+    {
+
+        DataHelper dh;
+
+        DataTable dt;
+
+        DataTable DB;
+
+        /// <summary>
+        /// 用户编号
+        /// </summary>
+        string iusercode;
+        /// <summary>
+        /// 岗位资源
+        /// </summary>
+        string isource;
+
+        Tip tipform;
+
+        Thread InitDB;
+        /// <summary>
+        /// 线别
+        /// </summary>
+        string ilinecode;
+        /// <summary>
+        /// 不良代码组
+        /// </summary>
+        string ibadgroup;
+        /// <summary>
+        /// 当前工序
+        /// </summary>
+        string istepcode;
+        StringBuilder sql = new StringBuilder();
+        /// <summary>
+        /// 缓存的文件
+        /// </summary>
+        public static string CachePath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/UAS_MES/XmlAnalysor/Cache.xml";
+        /// <summary>
+        /// 缓存的文件夹
+        /// </summary>
+        public static string CachePathFolder = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/UAS_MES/XmlAnalysor/";
+        /// <summary>
+        /// 需要解析的文件名
+        /// </summary>
+        List<string> _FileName = new List<string>();
+
+        ftpOperater ftp = new ftpOperater();
+
+        public AutoAnalysisXmlByStep()
+        {
+            tipform = new Tip();
+            InitializeComponent();
+            StartPosition = FormStartPosition.CenterScreen;
+        }
+
+        public AutoAnalysisXmlByStep(string iUserName, string iSource)
+        {
+            tipform = new Tip();
+            InitializeComponent();
+            iusercode = iUserName;
+            isource = iSource.ToUpper();
+            StartPosition = FormStartPosition.CenterScreen;
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            tipform.Show();
+            CheckForIllegalCrossThreadCalls = false;
+            FormBorderStyle = FormBorderStyle.FixedSingle;
+            InitDB = new Thread(ConnectDB);
+            //添加监控事件
+            XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
+            SetLoadingWindow stw = new SetLoadingWindow(InitDB, "正在启动程序");
+            stw.StartPosition = FormStartPosition.CenterScreen;
+            stw.ShowDialog();
+            List<string> CacheInf = new List<string>();
+            DB = (DataTable)dh.ExecuteSql("select ms_pwd,ma_user,ma_address,ma_inneraddress from master where ma_user='MES'", "select");
+            Master.DataSource = DB;
+            Master.DisplayMember = "ma_user";
+            Master.ValueMember = "ma_user";
+            //获取缓存信息
+            try
+            {
+                //FolderPath.Text = BaseUtil.GetCacheData("FolderPath").ToString();
+                //BackUpFolderPath.Text = BaseUtil.GetCacheData("BackUpFolderPath").ToString();
+                //Master.Text = BaseUtil.GetCacheData("Master").ToString();
+                //AutoStart.Checked = (bool)BaseUtil.GetCacheData("AutoStart");
+            }
+            catch (Exception ex) { MessageBox.Show(ex.Message); }
+            for (int i = 0; i < DB.Rows.Count; i++)
+            {
+                if (Master.Text == DB.Rows[i]["ma_user"].ToString())
+                {
+                    DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DGW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    dh = new DataHelper();
+                }
+            }
+            //获取岗位资源相关信息
+            DataTable dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode,st_badgroupcode from source left join step on sc_stepcode=st_code where sc_code='" + isource + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                ilinecode = dt.Rows[0]["sc_linecode"].ToString();
+                istepcode = dt.Rows[0]["sc_stepcode"].ToString();
+                ibadgroup = dt.Rows[0]["st_badgroupcode"].ToString();
+            }
+        }
+
+        private void ConnectDB()
+        {
+            dh = new DataHelper();
+        }
+
+        private void StartWatch_Click(object sender, EventArgs e)
+        {
+            if (FolderPath.Text == "")
+            {
+                OperateResult.AppendText("请选择监控文件夹\n");
+                return;
+            }
+            else
+            {
+                if (!Directory.Exists(FolderPath.Text))
+                {
+                    OperateResult.AppendText("监控文件夹不存在\n");
+                    return;
+                }
+            }
+            for (int i = 0; i < DB.Rows.Count; i++)
+            {
+                if (Master.Text == DB.Rows[i]["ma_user"].ToString())
+                {
+                    DataHelper.DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DGW;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+                    dh = new DataHelper();
+                    LogicHandler.dh = new DataHelper();
+                }
+            }
+            //存在工单必须是已下放状态
+            if ((!dh.CheckExist("make", "ma_statuscode='STARTED' and ma_code='" + ma_code.Text + "'") || ma_code.Text == "") && Device.Text == "AOI设备")
+            {
+                OperateResult.AppendText("工单不存在或者未下放\n");
+                return;
+            }
+            XmlWatcher.Path = FolderPath.Text;
+            XmlWatcher.Filter = "*.txt";
+            XmlWatcher.EnableRaisingEvents = true;
+            //设置缓存数据
+            //BaseUtil.SetCacheData("FolderPath", FolderPath.Text);
+            //BaseUtil.SetCacheData("BackUpFolderPath", BackUpFolderPath.Text);
+            //BaseUtil.SetCacheData("Master", Master.Text);
+            //BaseUtil.SetCacheData("AutoStart", AutoStart.Checked);
+            Timer.Interval = 1000 * 10;
+            Timer.Start();
+            //设置按钮不可点击
+            StartWatch.Enabled = false;
+            ChooseFolder.Enabled = false;
+            Master.Enabled = false;
+            ma_code.Enabled = false;
+            StopWatch.Enabled = true;
+            OperateResult.AppendText("开始执行监控\n");
+        }
+
+        public void CreateNode(XmlDocument xmlDoc, XmlNode parentNode, string name, string value)
+        {
+            XmlNode node = xmlDoc.CreateNode(XmlNodeType.Element, name, null);
+            node.InnerText = value;
+            parentNode.AppendChild(node);
+        }
+
+        private void XmlWatcher_Created(object sender, FileSystemEventArgs e)
+        {
+            //while (true)
+            //{
+            //    try
+            //    {
+            //        using (Stream stream = File.Open(e.FullPath, FileMode.Open, FileAccess.Read, FileShare.Read))
+            //        {
+            //            if (stream != null)
+            //                break;
+            //        }
+            //    }
+            //    catch (Exception ex)
+            //    {
+            //        Console.WriteLine(ex.Message);
+            //    }
+            //}
+            //switch (e.Name.Substring(e.Name.LastIndexOf(".") + 1).ToUpper())
+            //{
+            //    case "TXT":
+            //        TxtHandleProcess(e.FullPath);
+            //        break;
+            //    case "XML":
+            //        XmlHandleProcess(e.FullPath);
+            //        break;
+            //    default:
+            //        break;
+            //}
+        }
+        string nextLine;
+        private void TxtHandleProcess(string FileName)
+        {
+            List<string> badcode = new List<string>();
+            List<string> badlocation = new List<string>();
+            List<string> badprod = new List<string>();
+            if (Device.Text == "AOI设备")
+            {
+                StreamReader sR = File.OpenText(FileName);
+
+                DataTable filedt = new DataTable();
+                //文件内的行,用一个DataTable存储
+                int Rowindex = 0;
+                while ((nextLine = sR.ReadLine()) != null)
+                {
+                    //DataTable用第一行的数据作为列名
+                    string[] title = nextLine.Split(',');
+                    DataRow dr = filedt.NewRow();
+                    for (int i = 0; i < title.Length; i++)
+                    {
+                        if (Rowindex == 0)
+                        {
+                            filedt.Columns.Add(title[i]);
+                        }
+                        else
+                        {
+                            dr[filedt.Columns[i].ColumnName] = title[i];
+                        }
+                    }
+                    //除了第一行,然后添加到表格中
+                    if (Rowindex > 0)
+                    {
+                        filedt.Rows.Add(dr);
+                    }
+                    Rowindex = Rowindex + 1;
+                }
+                sR.Close();
+                string SN = FileName.Substring(FileName.LastIndexOf(@"\") + 1).Replace("-", "/").ToUpper().Replace(".TXT", "");
+                string Result = "OK";
+                string makecode = "";
+                string stepcode = "";
+                string oErrMessage = "";
+                string oMSID = "";
+                isource = "SMT_01_AOI";
+                iusercode = "SMT_01_AOI";
+                DataTable dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode,st_badgroupcode from source left join step on sc_stepcode=st_code where sc_code='" + isource + "'", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    ilinecode = dt.Rows[0]["sc_linecode"].ToString();
+                    istepcode = dt.Rows[0]["sc_stepcode"].ToString();
+                    ibadgroup = dt.Rows[0]["st_badgroupcode"].ToString();
+                }
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, isource, SN, iusercode, out makecode, out oMSID, out oErrMessage))
+                {
+                    for (int i = 0; i < filedt.Rows.Count; i++)
+                    {
+                        if (filedt.Rows[i]["c_result"].ToString() != "OK" && filedt.Rows[i]["c_result"].ToString() != "FC")
+                        {
+                            Result = "NG";
+                            //只添加一条记录
+                            if (badcode.Count == 0 && filedt.Rows[i]["w_ng_name"].ToString() != "")
+                            {
+                                badcode.Add(filedt.Rows[i]["w_ng_name"].ToString());
+                                badlocation.Add(filedt.Rows[i]["c_subboard_number"].ToString());
+                                badprod.Add(filedt.Rows[i]["c_subboard_number"].ToString());
+                            }
+                        }
+                    }
+                    //获取序列号ID最大的工单
+                    dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id,ms_stepcode from makeserial where ms_sncode='" + SN + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        ma_code.Text = dt.Rows[0]["ms_makecode"].ToString();
+                        makecode = dt.Rows[0]["ms_makecode"].ToString();
+                        stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                        if (stepcode == istepcode)
+                        {
+                            tipform.startthread("序列号 " + SN + "已执行过" + istepcode, "NG");
+                            OperateResult.AppendText("序列号 " + SN + "已执行过" + istepcode + "\n");
+                        }
+                        switch (Result)
+                        {
+                            case "OK":
+                                if (!LogicHandler.SetStepResult(makecode, isource, SN, "自动过站采集", Result, iusercode, out oErrMessage))
+                                {
+                                    OperateResult.AppendText(oErrMessage + "\n");
+                                    tipform.startthread(oErrMessage, Result);
+                                }
+                                tipform.startthread("序列号 " + SN + "通过检测", Result);
+                                OperateResult.AppendText("序列号 " + SN + "通过检测" + "\n");
+                                break;
+                            case "NG":
+                                RecordBadInfo(SN, makecode, FileName, "", badcode.ToArray(), badlocation.ToArray(), badprod.ToArray());
+                                //所有的序列号均采集为良品
+                                if (!LogicHandler.SetTestNGDetail(SN, makecode, iusercode, isource, Result, out oErrMessage))
+                                {
+                                    OperateResult.AppendText(oErrMessage + "\n");
+                                    tipform.startthread(oErrMessage, Result);
+                                }
+                                tipform.startthread("序列号 " + SN + "未通过检测", Result);
+                                OperateResult.AppendText("序列号 " + SN + "未通过检测" + "\n");
+                                break;
+                            default:
+                                break;
+                        }
+                        File.Delete(FileName);
+                    }
+                }
+                else
+                {
+                    OperateResult.AppendText(oErrMessage + "\n");
+                    tipform.startthread(oErrMessage, Result);
+                    //File.Delete(FileName);
+                }
+            }
+            else if (Device.Text == "测试设备")
+            {
+                try
+                {
+                    string filename = FileName;
+                    if (filename.Substring(filename.LastIndexOf(".") + 1).ToUpper() == "TXT")
+                    {
+                        string folderpath = FileName.Substring(0, FileName.LastIndexOf(@"\"));
+                        string SN = FileName.Substring(FileName.LastIndexOf(@"\") + 1).Replace("-", "/").ToUpper().Replace(".TXT", "");
+                        if (SN.Length == 12)
+                        {
+                            string Result = "";
+                            string makecode = ma_code.Text;
+                            string oErrMessage = "";
+                            string oMSID = "";
+                            string ms_sncode = dh.getFieldDataByCondition("makeserial", "ms_sncode", "substr(ms_sncode,0,12)='" + SN + "' order by ms_id").ToString();
+                            if (ms_sncode == "")
+                            {
+                                OperateResult.AppendText("序列号: " + SN + "前工段未扫描\n");
+                                return;
+                            }
+                            isource = "SMT_01_TEST01";
+                            iusercode = "SMT_01_TEST01";
+                            DataTable dt = (DataTable)dh.ExecuteSql("select sc_linecode,sc_stepcode,st_badgroupcode from source left join step on sc_stepcode=st_code where sc_code='" + isource + "'", "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                ilinecode = dt.Rows[0]["sc_linecode"].ToString();
+                                istepcode = dt.Rows[0]["sc_stepcode"].ToString();
+                                ibadgroup = dt.Rows[0]["st_badgroupcode"].ToString();
+                            }
+                            if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, isource, ms_sncode, iusercode, out makecode, out oMSID, out oErrMessage))
+                            {
+                                ma_code.Text = makecode;
+                                if (LogicHandler.SetStepResult(makecode, isource, ms_sncode, "自动过站采集", "OK", iusercode, out oErrMessage))
+                                {
+                                    try
+                                    {
+                                        string ftppath = "/" + DateTime.Now.ToString("yyyy-MM-dd") + "/";
+                                        ftp.UpLoadFile(folderpath, SN + ".txt", ftppath, "");
+                                        int num = int.Parse(dh.ExecuteSql("insert into STEPTESTDETAIL (std_id,std_sn,std_makecode,std_indate,std_class)select STEPTESTDETAIL_seq.nextval,ms_sncode,ms_makecode,sysdate,'http://81.71.42.91:8099/ftp" + ftppath + SN + ".txt" + "' from makeserial where substr(ms_sncode,0,12)='" + SN + "'", "insert").ToString());
+                                        if (num > 0)
+                                        {
+                                            OperateResult.AppendText("序列号:" + SN + "上传成功\n");
+                                            File.Delete(FileName);
+                                        }
+                                        else
+                                        {
+                                            OperateResult.AppendText("序列号: " + SN + "前工段未扫描\n");
+                                            MessageBox.Show("序列号: " + ms_sncode + "前工段未扫描", "信息", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
+                                        }
+                                    }
+                                    catch (Exception ex)
+                                    {
+                                        Console.WriteLine(ex.Message);
+                                    }
+                                }
+                                else
+                                {
+                                    OperateResult.AppendText(oErrMessage + "\n");
+                                    tipform.startthread(oErrMessage, Result);
+
+                                }
+                                tipform.startthread("序列号 " + ms_sncode + "通过检测", Result);
+                                OperateResult.AppendText("序列号 " + ms_sncode + "通过检测" + "\n");
+                            }
+                            else
+                            {
+                                //File.Delete(FileName);
+                                OperateResult.AppendText(oErrMessage + "\n");
+                                tipform.startthread(oErrMessage, Result);
+                            }
+                        }
+                    }
+                    //OperateResult.AppendText("解析成功:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\n" + FileName + "\n");
+                }
+                catch (Exception e)
+                {
+                    OperateResult.AppendText("解析失败:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\n" + FileName + "\n" + e.Message + "\n");
+                }
+            }
+        }
+        /// <summary>
+        /// 使用进程处理文件,避免界面假死
+        /// </summary>
+        private void XmlHandleProcess(string FileName)
+        {
+            string test_date = "";
+            string test_result = "";
+            string test_sn = "";
+            string imageurl = "";
+            string oMSID = "";
+            string oErrMessage = "";
+            XmlReader myReader = XmlReader.Create(FolderPath.Text + @"\" + FileName);
+            OperateResult.AppendText("读取文件" + FileName + "\n");
+            //获取采集的项目名称
+            List<string> badcode = new List<string>();
+            //获取采集项目的结果
+            List<string> badlocation = new List<string>();
+            while (myReader.Read())
+            {
+                if (myReader.NodeType == XmlNodeType.Element && myReader.Name == "test" && myReader.IsStartElement())
+                {
+                    test_sn = myReader.GetAttribute("test_sn");
+                    test_result = myReader.GetAttribute("test_result");
+                    test_date = myReader.GetAttribute("test_date");
+                    imageurl = myReader.GetAttribute("imgurl");
+                }
+                //if (myReader.NodeType == XmlNodeType.Text)
+                //{
+                //    if (code_or_location % 2 == 0)
+                //    {
+                //        badcode.Add(myReader.Value);
+                //        code_or_location++;
+                //    }
+                //    else
+                //    {
+                //        badlocation.Add(myReader.Value);
+                //        code_or_location++;
+                //    }
+                //}
+                if (myReader.NodeType == XmlNodeType.Element && myReader.Name == "err_reason" && myReader.IsStartElement())
+                {
+                    badcode.Add(myReader.ReadInnerXml() + " ");
+                }
+                if (myReader.NodeType == XmlNodeType.Element && myReader.Name == "err_location" && myReader.IsStartElement())
+                {
+                    badlocation.Add(myReader.ReadInnerXml() + " ");
+                }
+            }
+            myReader.Close();
+            //获取文件名的序列号,如SA123456.xml,如果开头为-表示无条码需要自动获取
+            string sncode = FileName.Substring(0, 1) == "-" ? "" : FileName.Split('.')[0];
+            string makecode = "";
+            //获取序列号ID最大的工单号,所有序列号都测试为良品
+            if (sncode == "")
+            {
+                //获取资源,线别,工序相等,并且状态在线的序列号进行分配
+                sql.Clear();
+                sql.Append("select ms_sncode,ms_makecode from makeserial left join source on sc_code=ms_sccode where ");
+                sql.Append("sc_linecode='" + ilinecode + "' and ms_nextstepcode='" + istepcode + "' and ms_status=1 order by ms_id");
+                dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                if (dt.Rows.Count > 0)
+                {
+                    makecode = dt.Rows[0]["ms_makecode"].ToString();
+                    sncode = dt.Rows[0]["ms_sncode"].ToString();
+                }
+                else
+                {
+                    OperateResult.AppendText("当前线别在" + istepcode + "无可分配序列号");
+                    tipform.startthread("当前线别在" + istepcode + "无可分配序列号", "NG");
+                    return;
+                }
+                //-2-NG2017/10/2514:46:29.xml取第二位版号
+                string combinecode = FileName.Substring(1, 1);
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == "" ? makecode : ma_code.Text, isource, sncode, iusercode, out makecode, out oMSID, out oErrMessage))
+                {
+                    //插入日志
+                    LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, FileName, test_result == "NG" ? "-1" : "0", "-1", 0, "", "");
+                    //如果是不良品记录日志,用于测试采集判负
+                    if (test_result == "NG")
+                    {
+                        RecordBadInfo(sncode, makecode, FileName, combinecode, badcode.ToArray(), badlocation.ToArray(), null);
+                    }
+                    if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", "OK", iusercode, out oErrMessage))
+                    {
+                        OperateResult.AppendText(oErrMessage + "\n");
+                        tipform.startthread(oErrMessage, "NG");
+                        return;
+                    }
+                    tipform.startthread("序列号 " + sncode + "通过检测", test_result);
+                }
+                else
+                {
+                    OperateResult.AppendText(oErrMessage + "\n");
+                    tipform.startthread(oErrMessage, "NG");
+                    return;
+                }
+            }
+            else
+            {
+                string status = "";
+                string errmessage = "";
+                bool NoteAlready = false;
+                LogicHandler.GetMakeInfo(sncode, out makecode, out status, out errmessage);
+                if (ma_code.Text != makecode && makecode != "" && ma_code.Text != "" && status != "2")
+                {
+                    string ChangeMakeCode = MessageBox.Show(this.ParentForm, "序列号" + sncode + "所属工单不同,是否切换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                    //如果选择不切换赋值当前界面工单
+                    if (ChangeMakeCode != "Yes")
+                    {
+                        makecode = ma_code.Text;
+                    }
+                    else
+                    {
+                        NoteAlready = true;
+                    }
+                }
+                if (LogicHandler.CheckStepSNAndMacode(ma_code.Text == "" ? makecode : ma_code.Text, isource, sncode, iusercode, out makecode, out oMSID, out oErrMessage))
+                {
+                    if (!NoteAlready)
+                    {
+                        if (makecode != ma_code.Text && ma_code.Text != "")
+                        {
+                            string ChangeMakeCode = MessageBox.Show(this.ParentForm, "序列号所属工单不同,是否切换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                            //如果选择不切换赋值当前界面工单
+                            if (ChangeMakeCode == "Yes")
+                            {
+                                ma_code.Text = makecode;
+                            }
+                            else
+                            {
+                                OperateResult.AppendText(">>请重新采集序列号\n");
+                                tipform.startthread("请重新采集序列号", test_result);
+                                return;
+                            }
+                        }
+                    }
+                    //获取序列号ID最大的工单
+                    dt = (DataTable)dh.ExecuteSql("select ms_makecode,ms_id from makeserial where ms_sncode='" + sncode + "' order by ms_id desc", "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        ma_code.Text = dt.Rows[0]["ms_makecode"].ToString();
+                        makecode = dt.Rows[0]["ms_makecode"].ToString();
+                        switch (test_result)
+                        {
+                            case "OK":
+                                if (!LogicHandler.SetStepResult(makecode, isource, sncode, "自动过站采集", test_result, iusercode, out oErrMessage))
+                                {
+                                    OperateResult.AppendText(oErrMessage + "\n");
+                                    tipform.startthread(oErrMessage, test_result);
+                                    return;
+                                }
+                                tipform.startthread("序列号 " + sncode + "通过检测", test_result);
+                                break;
+                            case "NG":
+                                RecordBadInfo(sncode, makecode, FileName, "", badcode.ToArray(), badlocation.ToArray(), null);
+                                //所有的序列号均采集为良品
+                                if (!LogicHandler.SetTestNGDetail(sncode, makecode, iusercode, isource, test_result, out oErrMessage))
+                                {
+                                    OperateResult.AppendText(oErrMessage + "\n");
+                                    tipform.startthread(oErrMessage, test_result);
+                                    return;
+                                }
+                                tipform.startthread("序列号 " + sncode + "未通过检测", test_result);
+                                break;
+                            default:
+                                break;
+                        }
+                        LogicHandler.AutoPassLog(sncode, isource, makecode, test_date, istepcode, ilinecode, FileName, test_result == "NG" ? "1" : "0", "0", 0, "", "");
+                    }
+                }
+                else
+                {
+                    OperateResult.AppendText(oErrMessage + "\n");
+                    tipform.startthread(oErrMessage, "NG");
+                    return;
+                }
+            }
+            FileInfo file = new FileInfo(FolderPath.Text + @"\" + FileName);
+            if (file.Exists)
+            {
+                try
+                {
+
+                }
+                catch (Exception ex)
+                {
+                    OperateResult.AppendText(FileName + ex.Message + "\n");
+                }
+            }
+        }
+
+        private void RecordBadInfo(string sncode, string makecode, string filename, string combine, string[] badcode, string[] badlocation, string[] soncode)
+        {
+            string[] ID = dh.GetSEQ("makebad_seq", badcode.Length);
+            sql.Clear();
+            sql.Append("update makebad set mb_status=-1 where mb_sncode='" + sncode + "' and mb_stepcode='" + istepcode + "' and mb_makecode='" + makecode + "' and mb_status=0");
+            dh.ExecuteSql(sql.ToString(), "update");
+            sql.Clear();
+            sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
+            sql.Append(",mb_sourcecode,mb_badname,mb_bgcode,mb_badtable,mb_status,mb_badlocation,mb_soncode,mb_content) select :ID");
+            sql.Append(",ma_code,ms_code,ms_sncode,'" + iusercode + "',sysdate,'" + istepcode + "','" + isource + "',");
+            sql.Append(":bc_code,'WG','','0',:location,:soncode,'" + nextLine + "' from make left join makeSerial on ms_makecode=ma_code ");
+            sql.Append("where ms_sncode='" + sncode + "' and ms_makecode='" + makecode + "'");
+            dh.BatchInsert(sql.ToString(), new string[] { "ID", "bc_code", "location", "soncode" }, ID, badcode, badlocation, soncode);
+            sql.Clear();
+            sql.Append("update makebad set mb_badcode=(select DISTINCT bc_code from badcode where bc_name=mb_badcode),mb_badname=mb_badcode,mb_bgname=(select DISTINCT bg_name from badgroup where bg_code=mb_bgcode) ");
+            sql.Append("where mb_id=:ID");
+            dh.BatchInsert(sql.ToString(), new string[] { "ID" }, ID);
+            //记录判断日志
+            if (dh.getFieldDataByCondition("source", "sc_scantype", "sc_code='" + isource + "'").ToString() == "REJUCE")
+            {
+                LogicHandler.AutoPassJudge(sncode, makecode, isource, filename, ilinecode, combine);
+            }
+        }
+
+        private void StopWatch_Click(object sender, EventArgs e)
+        {
+            XmlWatcher.EnableRaisingEvents = false;
+            StartWatch.Enabled = true;
+            ma_code.Enabled = true;
+            Master.Enabled = true;
+            ChooseFolder.Enabled = true;
+
+            StopWatch.Enabled = false;
+            OperateResult.AppendText("停止执行监控\n");
+        }
+
+        private void Clean_Click(object sender, EventArgs e)
+        {
+            OperateResult.Clear();
+        }
+
+        private void ChooseFolder_Click(object sender, EventArgs e)
+        {
+            FolderBrowserDialog folder = new FolderBrowserDialog();
+            folder.Description = "选择监控文件夹";
+            DialogResult result = folder.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                FolderPath.Text = folder.SelectedPath;
+            }
+        }
+
+        private void ChooseBackUpFolder_Click(object sender, EventArgs e)
+        {
+            FolderBrowserDialog folder = new FolderBrowserDialog();
+            folder.Description = "选择备份文件夹";
+            DialogResult result = folder.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+
+            }
+        }
+
+        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            string ExitConfirm = MessageBox.Show(this, "确认退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+            if (ExitConfirm != "Yes")
+            {
+                WindowState = FormWindowState.Minimized;
+                e.Cancel = true;
+            }
+        }
+
+        private void AutoStart_CheckedChanged(object sender, EventArgs e)
+        {
+            SetAutoRun();
+        }
+
+        private void SetAutoRun()
+        {
+            if (AutoStart.Checked) //设置开机自启动  
+            {
+                string path = Application.ExecutablePath;
+                RegistryKey rk = Registry.LocalMachine;
+                RegistryKey rk2 = rk.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
+                rk2.SetValue("UAS自动过站解析器.exe", path);
+                rk2.Close();
+                rk.Close();
+            }
+            else //取消开机自启动  
+            {
+                string path = Application.ExecutablePath;
+                RegistryKey rk = Registry.LocalMachine;
+                RegistryKey rk2 = rk.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run");
+                rk2.DeleteValue("UAS自动过站解析器.exe", false);
+                rk2.Close();
+                rk.Close();
+            }
+        }
+
+        private void BatchAnalysus_Click(object sender, EventArgs e)
+        {
+            var AllXmls = Directory.GetFiles(FolderPath.Text, "*.txt");
+            foreach (var Xml in AllXmls)
+            {
+                TxtHandleProcess(Xml);
+            }
+        }
+
+        private void Timer_Tick(object sender, EventArgs e)
+        {
+            var AllXmls = Directory.GetFiles(FolderPath.Text, "*.txt");
+            foreach (var Xml in AllXmls)
+            {
+                TxtHandleProcess(Xml);
+            }
+        }
+    }
+}

+ 129 - 0
FileWatcher/AutoAnalysisXmlByStep.resx

@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <metadata name="XmlWatcher.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+  <metadata name="XmlFolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>164, 17</value>
+  </metadata>
+  <metadata name="Timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>296, 17</value>
+  </metadata>
+</root>

+ 2 - 2
FileWatcher/DataHelper.cs

@@ -9,9 +9,9 @@ namespace FileWatcher
     class DataHelper
     {
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=JWXH;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         //用户选择的数据库的连接字符串
-        public static string DBConnectionString= "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=JWXH;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        public static string DBConnectionString= "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=81.71.42.91)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         public static OracleConnection connection = null;
         OracleCommand command = null;
         int ReconnectTime = 0;

+ 18 - 0
FileWatcher/FileWatcher.csproj

@@ -51,6 +51,12 @@
     </Reference>
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="AutoAnalysisXmlByStep.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="AutoAnalysisXmlByStep.Designer.cs">
+      <DependentUpon>AutoAnalysisXmlByStep.cs</DependentUpon>
+    </Compile>
     <Compile Include="AutoAnalysisXml.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -85,6 +91,12 @@
       <DependentUpon>LoadingCircle.cs</DependentUpon>
     </Compile>
     <Compile Include="LogicHandler.cs" />
+    <Compile Include="Login.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Login.Designer.cs">
+      <DependentUpon>Login.cs</DependentUpon>
+    </Compile>
     <Compile Include="SetLoadingWindow.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -111,6 +123,9 @@
     </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="AutoAnalysisXmlByStep.resx">
+      <DependentUpon>AutoAnalysisXmlByStep.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="AutoAnalysisXml.resx">
       <DependentUpon>AutoAnalysisXml.cs</DependentUpon>
     </EmbeddedResource>
@@ -123,6 +138,9 @@
     <EmbeddedResource Include="Form3.resx">
       <DependentUpon>Form3.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Login.resx">
+      <DependentUpon>Login.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="SetLoadingWindow.resx">
       <DependentUpon>SetLoadingWindow.cs</DependentUpon>
     </EmbeddedResource>

+ 167 - 0
FileWatcher/Login.Designer.cs

@@ -0,0 +1,167 @@
+namespace FileWatcher
+{
+    partial class Login
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.UserName = new System.Windows.Forms.TextBox();
+            this.UserName_lable = new System.Windows.Forms.Label();
+            this.PassWord = new System.Windows.Forms.TextBox();
+            this.PassWord_label = new System.Windows.Forms.Label();
+            this.Source = new System.Windows.Forms.TextBox();
+            this.Source_label = new System.Windows.Forms.Label();
+            this.CheckLogin = new System.Windows.Forms.Button();
+            this.Master = new System.Windows.Forms.ComboBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.SuspendLayout();
+            // 
+            // UserName
+            // 
+            this.UserName.Location = new System.Drawing.Point(297, 43);
+            this.UserName.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.UserName.Name = "UserName";
+            this.UserName.Size = new System.Drawing.Size(236, 35);
+            this.UserName.TabIndex = 5;
+            // 
+            // UserName_lable
+            // 
+            this.UserName_lable.AutoSize = true;
+            this.UserName_lable.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.UserName_lable.Location = new System.Drawing.Point(140, 38);
+            this.UserName_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.UserName_lable.Name = "UserName_lable";
+            this.UserName_lable.Size = new System.Drawing.Size(114, 41);
+            this.UserName_lable.TabIndex = 4;
+            this.UserName_lable.Text = "用户名";
+            // 
+            // PassWord
+            // 
+            this.PassWord.Location = new System.Drawing.Point(297, 132);
+            this.PassWord.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.PassWord.Name = "PassWord";
+            this.PassWord.PasswordChar = '*';
+            this.PassWord.Size = new System.Drawing.Size(236, 35);
+            this.PassWord.TabIndex = 7;
+            // 
+            // PassWord_label
+            // 
+            this.PassWord_label.AutoSize = true;
+            this.PassWord_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PassWord_label.Location = new System.Drawing.Point(171, 123);
+            this.PassWord_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.PassWord_label.Name = "PassWord_label";
+            this.PassWord_label.Size = new System.Drawing.Size(82, 41);
+            this.PassWord_label.TabIndex = 6;
+            this.PassWord_label.Text = "密码";
+            // 
+            // Source
+            // 
+            this.Source.Location = new System.Drawing.Point(297, 223);
+            this.Source.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.Source.Name = "Source";
+            this.Source.Size = new System.Drawing.Size(236, 35);
+            this.Source.TabIndex = 9;
+            // 
+            // Source_label
+            // 
+            this.Source_label.AutoSize = true;
+            this.Source_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Source_label.Location = new System.Drawing.Point(171, 214);
+            this.Source_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Source_label.Name = "Source_label";
+            this.Source_label.Size = new System.Drawing.Size(82, 41);
+            this.Source_label.TabIndex = 8;
+            this.Source_label.Text = "资源";
+            // 
+            // CheckLogin
+            // 
+            this.CheckLogin.Location = new System.Drawing.Point(329, 376);
+            this.CheckLogin.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.CheckLogin.Name = "CheckLogin";
+            this.CheckLogin.Size = new System.Drawing.Size(112, 48);
+            this.CheckLogin.TabIndex = 10;
+            this.CheckLogin.Text = "登陆";
+            this.CheckLogin.UseVisualStyleBackColor = true;
+            this.CheckLogin.Click += new System.EventHandler(this.CheckLogin_Click);
+            // 
+            // Master
+            // 
+            this.Master.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.Master.FormattingEnabled = true;
+            this.Master.Location = new System.Drawing.Point(297, 308);
+            this.Master.Margin = new System.Windows.Forms.Padding(6);
+            this.Master.Name = "Master";
+            this.Master.Size = new System.Drawing.Size(236, 32);
+            this.Master.TabIndex = 17;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(120, 302);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(133, 38);
+            this.label4.TabIndex = 16;
+            this.label4.Text = "账套选择";
+            // 
+            // Login
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(762, 458);
+            this.Controls.Add(this.Master);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.CheckLogin);
+            this.Controls.Add(this.Source);
+            this.Controls.Add(this.Source_label);
+            this.Controls.Add(this.PassWord);
+            this.Controls.Add(this.PassWord_label);
+            this.Controls.Add(this.UserName);
+            this.Controls.Add(this.UserName_lable);
+            this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.Name = "Login";
+            this.Text = "Login";
+            this.Load += new System.EventHandler(this.Login_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.TextBox UserName;
+        private System.Windows.Forms.Label UserName_lable;
+        private System.Windows.Forms.TextBox PassWord;
+        private System.Windows.Forms.Label PassWord_label;
+        private System.Windows.Forms.TextBox Source;
+        private System.Windows.Forms.Label Source_label;
+        private System.Windows.Forms.Button CheckLogin;
+        private System.Windows.Forms.ComboBox Master;
+        private System.Windows.Forms.Label label4;
+    }
+}

+ 51 - 0
FileWatcher/Login.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Data;
+using System.Windows.Forms;
+
+namespace FileWatcher
+{
+    public partial class Login : Form
+    {
+
+        DataHelper dh = new DataHelper();
+
+        public Login()
+        {
+            StartPosition = FormStartPosition.CenterScreen;
+            InitializeComponent();
+        }
+
+        private void CheckLogin_Click(object sender, EventArgs e)
+        {
+            string ErrMessage = "";
+            if (LogicHandler.CheckUserLogin(UserName.Text, PassWord.Text, out ErrMessage))
+            {
+                if (LogicHandler.CheckUserAndResourcePassed(UserName.Text, Source.Text, out ErrMessage))
+                {
+                    BaseUtil.SetCacheData("UserName", UserName.Text);
+                    BaseUtil.SetCacheData("Source", Source.Text);
+                    AutoAnalysisXml xml = new AutoAnalysisXml(UserName.Text, Source.Text,Master.Text);
+                    Hide();
+                    xml.ShowDialog();
+                    Close();
+                }
+                else MessageBox.Show(ErrMessage);
+            }
+            else MessageBox.Show(ErrMessage);
+        }
+
+        private void Login_Load(object sender, EventArgs e)
+        {
+            DataTable DB = (DataTable)dh.ExecuteSql("select ms_pwd,ma_user,ma_address,ma_inneraddress from master ", "select");
+            Master.DataSource = DB;
+            Master.DisplayMember = "ma_user";
+            Master.ValueMember = "ma_user";
+            UserName.Text = BaseUtil.GetCacheData("UserName").ToString();
+            Source.Text = BaseUtil.GetCacheData("Source").ToString();
+            if (UserName.Text != "")
+            {
+                PassWord.Focus();
+            }
+        }
+    }
+}

+ 120 - 0
FileWatcher/Login.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 1 - 1
FileWatcher/Program.cs

@@ -45,7 +45,7 @@ namespace FileWatcher
                 Application.EnableVisualStyles();
                 Application.SetCompatibleTextRenderingDefault(false);
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
-                    Application.Run(new Form3());
+                    Application.Run(new Login());
                 else
                 {
                     //创建启动对象