Ver código fonte

Merge remote-tracking branch 'refs/remotes/origin/master'

shim 8 anos atrás
pai
commit
1b4ebd3b8a

+ 16 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -44,6 +44,7 @@
             this.unload = new System.Windows.Forms.RadioButton();
             this.code_label = new System.Windows.Forms.Label();
             this.PrintNum = new System.Windows.Forms.NumericUpDown();
+            this.ma_bomversion = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
@@ -218,6 +219,18 @@
             0,
             0});
             // 
+            // ma_bomversion
+            // 
+            this.ma_bomversion.AutoSize = true;
+            this.ma_bomversion.CutLength = null;
+            this.ma_bomversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_bomversion.Location = new System.Drawing.Point(772, 187);
+            this.ma_bomversion.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ma_bomversion.Name = "ma_bomversion";
+            this.ma_bomversion.Size = new System.Drawing.Size(0, 21);
+            this.ma_bomversion.TabIndex = 169;
+            this.ma_bomversion.Visible = false;
+            // 
             // code
             // 
             this.code.AllPower = null;
@@ -310,6 +323,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(969, 452);
+            this.Controls.Add(this.ma_bomversion);
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.code_label);
             this.Controls.Add(this.code);
@@ -336,7 +350,7 @@
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Name = "Make_ColorBoxLoadPrint";
             this.Tag = "Make!ColorBoxLoadPrint";
-            this.Text = "标签打印";
+            this.Text = "s";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.标签打印_FormClosing);
             this.Load += new System.EventHandler(this.标签打印_Load);
             this.SizeChanged += new System.EventHandler(this.标签打印_SizeChanged);
@@ -370,5 +384,6 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox code;
         private System.Windows.Forms.Label code_label;
         private System.Windows.Forms.NumericUpDown PrintNum;
+        private CustomControl.ValueLabel.ValueLabel ma_bomversion;
     }
 }

+ 7 - 7
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -81,7 +81,7 @@ namespace UAS_MES.Make
                         if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out ma_code, out Msid, out ErrorMessage) || ListA.Rows.Count > 0)
                         {
                             sql.Clear();
-                            sql.Append("select ms_makecode,ms_sncode,ma_qty,pr_detail,pr_code from makeserial left join make on ");
+                            sql.Append("select ms_makecode,ms_sncode,ma_qty,pr_detail,pr_code,ma_bomversion from makeserial left join make on ");
                             sql.Append("ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_sncode=:sncode");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", code.Text);
                             if (dt.Rows.Count > 0)
@@ -90,7 +90,7 @@ namespace UAS_MES.Make
                                 LoadCollectNum();
                                 if (PrintLabel.SelectedValue == null)
                                 {
-                                    OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护机身标签\n", Color.Red);
+                                    OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护彩盒标签\n", Color.Red);
                                     return;
                                 }
                                 ms_sncode.Text = code.Text;
@@ -101,7 +101,7 @@ namespace UAS_MES.Make
                                 OperateResult.AppendText(">>开始执行上料工序\n");
                                 //判断当前工序是否是上料工序cd_ifinput或者是否是测试工序cd_iftest
                                 sql.Clear();
-                                sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
+                                sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest,ma_bomversion from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
                                 sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + code.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 if (dt.Rows.Count > 0)
@@ -113,9 +113,9 @@ namespace UAS_MES.Make
                                         sql.Clear();
                                         sql.Append("select sp_id,sp_description,sp_soncode,pr_detail,pr_spec,sp_repcode,pr_id,sp_type,");
                                         sql.Append("'未采集' sp_ifpick ,sp_prefix,sp_length,sp_regex,sp_regex,sp_ifforsn from stepproduct ");
-                                        sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cr_code"].ToString() + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' ");
-                                        sql.Append("And sp_mothercode='" + pr_code.Text + "' and ((sp_type='物料' and pr_tracekind<>2)or sp_type<>'物料') ");
-                                        sql.Append("order by SP_DETNO asc");
+                                        sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cr_code"].ToString() + "' ");
+                                        sql.Append("and sp_bomversion='" + ma_bomversion.Text + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' And sp_mothercode='" + pr_code.Text + "' and ");
+                                        sql.Append("((sp_type='物料' and pr_tracekind<>2)or sp_type<>'物料') order by SP_DETNO asc");
                                         ListA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                         //获取对应 产品的机身标的打印模板
                                         if (ListA.Rows.Count > 0)
@@ -225,7 +225,7 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode,pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode,pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "' and pl_labeltype='彩盒标' order by pl_isdefault desc", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";

+ 5 - 11
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -23,14 +23,10 @@ namespace UAS_MES.Make
         string nextstepcode;
         //完工状态
         string ms_status;
-        //流程码
-        string ms_code;
-        //工序名称
-        string stepname;
         //工艺路线编号
         string ms_craftcode;
-        //管控类型
-
+        //Bom版本
+        string ma_bomversion;
         string ErrorMessage="";
 
         //用于提醒的序列B
@@ -121,7 +117,6 @@ namespace UAS_MES.Make
                                 make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
                                 nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
                                 ms_status = dt.Rows[0]["ms_status"].ToString();
-                                ms_code = dt.Rows[0]["ms_code"].ToString();
                             }
                             //勾选了前一工单
                             if (iflastsn.Checked)
@@ -398,7 +393,7 @@ namespace UAS_MES.Make
         {
             //将录入框的值给序列号
             sql.Clear();
-            sql.Append("select ma_prodcode,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
+            sql.Append("select ma_prodcode,ma_bomversion,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
             sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
             sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -407,11 +402,10 @@ namespace UAS_MES.Make
                 ms_id = dt.Rows[0]["ms_id"].ToString();
                 ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
                 make_code = dt.Rows[0]["ma_code"].ToString();
+                ma_bomversion = dt.Rows[0]["ma_bomversion"].ToString();
                 make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
                 nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                ms_code = dt.Rows[0]["ms_code"].ToString();
                 ms_status = dt.Rows[0]["ms_status"].ToString();
-                stepname = dt.Rows[0]["ms_stepname"].ToString();
                 BaseUtil.SetFormValue(this.Controls, dt);
                 bool ifFirst;
                 if (LogicHandler.CheckCurrentStepAndIfFirst(code.Text, ma_code.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
@@ -425,7 +419,7 @@ namespace UAS_MES.Make
                         sql.Clear();
                         sql.Append("select sp_id,sp_prefix,sp_ifuseregex,sp_ifforsn,sp_length,sp_description,sp_soncode,pr_tracekind,pr_detail,pr_spec,sp_repcode,pr_id,");
                         sql.Append("sp_type,case when (sp_type='物料' and sp_soncode=pr_code) then '已采集' else '未采集' end sp_ifpick ,sp_prefix,");
-                        sql.Append("sp_length,sp_regex,sp_ifforsn from stepproduct left join product on pr_code=sp_soncode where ");
+                        sql.Append("sp_length,sp_regex,sp_ifforsn from stepproduct left join product on pr_code=sp_soncode where sp_bomversion='"+ma_bomversion+"' and ");
                         sql.Append("sp_craftcode='" + ms_craftcode + "' and sp_stepcode='" + User.CurrentStepCode + "' And sp_mothercode ='" + make_prodcode + "' ");
                         sql.Append("and((sp_type = '物料' and( pr_tracekind <> 2 or pr_tracekind is null))or sp_type <> '物料') order by SP_DETNO asc");
                         dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");

+ 2 - 3
UAS_KanBan/Process.cs

@@ -26,10 +26,9 @@ namespace UAS_KanBan
             int WorkHeight = Screen.PrimaryScreen.Bounds.Width;
             if (WorkHeight <= 1024)
             {
-                机型.MaximumSize = new Size(300, 0);
                 for (int i = 0; i < this.Controls.Count; i++)
                 {
-                    if (Controls[i] is Label ||Controls[i] is ValueLabel)
+                    if (Controls[i] is Label || Controls[i] is ValueLabel)
                     {
                         if (Controls[i].Tag != null && Controls[i].Tag.ToString() == "AutoFont")
                             Controls[i].Font = new Font("宋体", Controls[i].Font.Size - 10, FontStyle.Bold);
@@ -48,7 +47,6 @@ namespace UAS_KanBan
             Refresh.Interval = Setting.RefreshRate * 1000;
             Refresh.Start();
             WindowState = FormWindowState.Maximized;
-
         }
 
         private void Refresh_Tick(object sender, EventArgs e)
@@ -95,6 +93,7 @@ namespace UAS_KanBan
             直通率.Location = new Point(直通率_label.Location.X + 直通率_label.Width + 30, 直通率_label.Location.Y);
             收益率.Location = new Point(收益率_label.Location.X + 收益率_label.Width + 30, 收益率_label.Location.Y);
             故障数.Location = new Point(故障数_label.Location.X + 故障数_label.Width + 30, 故障数_label.Location.Y);
+            机型.MaximumSize = new Size(直通率_label.Location.X - 机型_label.Location.X - 机型_label.Width-40, 0);
         }
 
         private void Process_FormClosing(object sender, FormClosingEventArgs e)

+ 2 - 2
UAS_KanBan/UAS_KanBan.csproj

@@ -28,10 +28,10 @@
     <ProductName>UAS看板</ProductName>
     <PublisherName>深圳市优软科技有限公司</PublisherName>
     <SuiteName>UAS看板</SuiteName>
-    <MinimumRequiredVersion>1.0.0.14</MinimumRequiredVersion>
+    <MinimumRequiredVersion>1.0.0.16</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>15</ApplicationRevision>
+    <ApplicationRevision>17</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>false</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>

+ 10 - 10
UAS_XmlAnalysor/App.config

@@ -1,33 +1,33 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
     <configSections>
-        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
-            <section name="UAS_XmlAnalysor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+            <section name="UAS_XmlAnalysor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
         </sectionGroup>
     </configSections>
     <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/>
     </startup>
     <userSettings>
         <UAS_XmlAnalysor.Properties.Settings>
-            <setting name="MES" serializeAs="String">
-                <value>Data Source=117.25.180.218/orcl;User ID=MES;PassWord=select!#%*(</value>
-            </setting>
             <setting name="FolderPath" serializeAs="String">
-                <value />
+                <value/>
             </setting>
             <setting name="BackUpFolderPath" serializeAs="String">
-                <value />
+                <value/>
             </setting>
             <setting name="Source" serializeAs="String">
-                <value />
+                <value/>
             </setting>
             <setting name="Master" serializeAs="String">
-                <value />
+                <value/>
             </setting>
             <setting name="AutoStart" serializeAs="String">
                 <value>False</value>
             </setting>
+            <setting name="MES" serializeAs="String">
+                <value>Data Source=117.25.180.218/orcl;User ID=MES;PassWord=select!#%*(</value>
+            </setting>
         </UAS_XmlAnalysor.Properties.Settings>
     </userSettings>
 </configuration>

Diferenças do arquivo suprimidas por serem muito extensas
+ 178 - 624
UAS_XmlAnalysor/DataHelper.cs


+ 59 - 14
UAS_XmlAnalysor/Form1.cs

@@ -15,6 +15,8 @@ namespace UAS_XmlAnalysor
 
         DataTable dt;
 
+        string CachePath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":/Cache/Cache.xml";
+
         public Form1()
         {
             InitializeComponent();
@@ -22,12 +24,25 @@ namespace UAS_XmlAnalysor
 
         private void Form1_Load(object sender, EventArgs e)
         {
-            FolderPath.Text = Properties.Settings.Default.FolderPath;
-            BackUpFolderPath.Text = Properties.Settings.Default.BackUpFolderPath;
-            Source.Text = Properties.Settings.Default.Source;
-            Master.Text = Properties.Settings.Default.Master;
-            AutoStart.Checked = Properties.Settings.Default.AutoStart;
-            dt = (DataTable)dh.ExecuteSql("select ms_pwd,ma_user,ma_address from master ", "select");
+            List<string> CacheInf = new List<string>();
+            try
+            {
+                XmlReader myReader = XmlReader.Create(CachePath);
+                while (myReader.Read())
+                {
+                    if (myReader.NodeType == XmlNodeType.Text)
+                        CacheInf.Add(myReader.Value);
+                }
+                myReader.Close();
+                string[] Info = CacheInf.ToArray();
+                FolderPath.Text = Info[0];
+                BackUpFolderPath.Text = Info[1];
+                Source.Text = Info[2];
+                Master.Text = Info[3];
+                AutoStart.Checked = (Info[4] == "True" ? true : false);
+            }
+            catch (Exception) { }
+            dt = (DataTable)dh.ExecuteSql("select ms_pwd,ma_user,ma_address from master", "select");
             Master.DataSource = dt;
             Master.DisplayMember = "ma_user";
             Master.ValueMember = "ma_user";
@@ -36,12 +51,21 @@ namespace UAS_XmlAnalysor
 
         private void StartWatch_Click(object sender, EventArgs e)
         {
+            if (FolderPath.Text == "" || BackUpFolderPath.Text == "")
+            {
+                OperateResult.AppendText("请选择监控文件夹和备份文件夹\n");
+                return;
+            }
+            if (FolderPath.Text == BackUpFolderPath.Text)
+            {
+                OperateResult.AppendText("监控文件夹和备份文件夹不能相同\n");
+                return;
+            }
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 if (Master.Text == dt.Rows[i]["ma_user"].ToString())
                 {
                     DataHelper.DBConnectionString = "Data Source=" + dt.Rows[i]["ma_address"] + ";User ID=" + dt.Rows[i]["ma_user"] + ";PassWord=" + dt.Rows[i]["ms_pwd"]; ;
-                    Console.WriteLine(DataHelper.DBConnectionString);
                     dh = new DataHelper();
                 }
             }
@@ -54,12 +78,26 @@ namespace UAS_XmlAnalysor
             XmlWatcher.Filter = "*.xml";
             XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
             XmlWatcher.EnableRaisingEvents = true;
-            Properties.Settings.Default.FolderPath = FolderPath.Text;
-            Properties.Settings.Default.BackUpFolderPath = BackUpFolderPath.Text;
-            Properties.Settings.Default.Source = Source.Text;
-            Properties.Settings.Default.Master = Master.Text;
-            Properties.Settings.Default.AutoStart = AutoStart.Checked;
-            Properties.Settings.Default.Save();
+            string CacheString = FolderPath.Text + "|" + BackUpFolderPath.Text + "|" + Source.Text + "|" + Master.Text + "|" + AutoStart.Checked;
+            //写入前先删除文件
+            try
+            {
+                File.Delete(CachePath);
+            }
+            catch (Exception) { }
+            XmlDocument xmlDoc = new XmlDocument();
+            //创建类型声明节点  
+            XmlNode node = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", "");
+            xmlDoc.AppendChild(node);
+            //创建根节点  
+            XmlElement xeRoot = xmlDoc.CreateElement("CacheInf");
+            xmlDoc.AppendChild(xeRoot);
+            CreateNode(xmlDoc, xeRoot, "FolderPath", FolderPath.Text);
+            CreateNode(xmlDoc, xeRoot, "BackUpFolderPath", BackUpFolderPath.Text);
+            CreateNode(xmlDoc, xeRoot, "Source", Source.Text);
+            CreateNode(xmlDoc, xeRoot, "Master", Master.Text);
+            CreateNode(xmlDoc, xeRoot, "AutoStart", AutoStart.Checked.ToString());
+            xmlDoc.Save(CachePath);
             Source.Enabled = false;
             StartWatch.Enabled = false;
             ChooseFolder.Enabled = false;
@@ -68,6 +106,13 @@ namespace UAS_XmlAnalysor
             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);
+        }
+
         public void SetAutoRun()
         {
             if (AutoStart.Checked) //设置开机自启动  
@@ -147,7 +192,7 @@ namespace UAS_XmlAnalysor
             {
                 try
                 {
-                    file.MoveTo(BackUpFolderPath.Text + @"\" + e.Name);
+                    file.MoveTo(BackUpFolderPath.Text + @"\" + DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss") + "-" + e.Name);
                 }
                 catch (Exception ex)
                 {

+ 45 - 1
UAS_XmlAnalysor/Program.cs

@@ -1,8 +1,10 @@
 using Microsoft.Win32;
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Security.Principal;
+using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
@@ -20,8 +22,18 @@ namespace UAS_XmlAnalysor
             {
                 WindowsIdentity identity = WindowsIdentity.GetCurrent();
                 WindowsPrincipal principal = new WindowsPrincipal(identity);
+
+                string sysdisc = Environment.GetEnvironmentVariable("windir").Substring(0, 1);
+                Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
+                //处理UI线程异常
+                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
+                //处理非UI线程异常
+                AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
+
                 Application.EnableVisualStyles();
                 Application.SetCompatibleTextRenderingDefault(false);
+                if (!Directory.Exists(sysdisc + @":\Cache"))
+                    Directory.CreateDirectory(sysdisc + @":\Cache");
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
                     Application.Run(new Form1());
                 else
@@ -68,5 +80,37 @@ namespace UAS_XmlAnalysor
                     reg.Close();
             }
         }
+        //处理线程的异常
+        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
+        {
+            string str = GetExceptionMsg(e.Exception, e.ToString());
+            MessageBox.Show(str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+        }
+
+        //未处理的异常统一通过这里返回
+        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+        {
+            string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
+            MessageBox.Show(str, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
+        }
+
+        /// <summary>
+        /// 生成自定义异常消息
+        /// </summary>
+        /// <param name="ex">异常对象</param>
+        /// <param name="backStr">备用异常消息:当ex为null时有效</param>
+        /// <returns>异常字符串文本</returns>
+        static string GetExceptionMsg(Exception ex, string backStr)
+        {
+            StringBuilder sb = new StringBuilder();
+            if (ex != null)
+            {
+                sb.AppendLine(ex.Message);
+                //sb.AppendLine("【异常方法】:" + ex.StackTrace);
+            }
+            //else { sb.AppendLine("【未处理异常】:" + backStr); }
+            return sb.ToString();
+        }
     }
-}
+
+}

+ 18 - 12
UAS_XmlAnalysor/Properties/Settings.Designer.cs

@@ -23,21 +23,10 @@ namespace UAS_XmlAnalysor.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=117.25.180.218/orcl;User ID=MES;PassWord=select!#%*(")]
-        public string MES {
-            get {
-                return ((string)(this["MES"]));
-            }
-            set {
-                this["MES"] = value;
-            }
-        }
-        
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("")]
+        [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
         public string FolderPath {
             get {
                 return ((string)(this["FolderPath"]));
@@ -50,6 +39,7 @@ namespace UAS_XmlAnalysor.Properties {
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("")]
+        [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
         public string BackUpFolderPath {
             get {
                 return ((string)(this["BackUpFolderPath"]));
@@ -62,6 +52,7 @@ namespace UAS_XmlAnalysor.Properties {
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("")]
+        [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
         public string Source {
             get {
                 return ((string)(this["Source"]));
@@ -74,6 +65,7 @@ namespace UAS_XmlAnalysor.Properties {
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("")]
+        [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
         public string Master {
             get {
                 return ((string)(this["Master"]));
@@ -86,6 +78,7 @@ namespace UAS_XmlAnalysor.Properties {
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("False")]
+        [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
         public bool AutoStart {
             get {
                 return ((bool)(this["AutoStart"]));
@@ -94,5 +87,18 @@ namespace UAS_XmlAnalysor.Properties {
                 this["AutoStart"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=117.25.180.218/orcl;User ID=MES;PassWord=select!#%*(")]
+        [global::System.Configuration.SettingsManageabilityAttribute(global::System.Configuration.SettingsManageability.Roaming)]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+            set {
+                this["MES"] = value;
+            }
+        }
     }
 }

+ 8 - 8
UAS_XmlAnalysor/Properties/Settings.settings

@@ -2,23 +2,23 @@
 <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UAS_XmlAnalysor.Properties" GeneratedClassName="Settings">
   <Profiles />
   <Settings>
-    <Setting Name="MES" Type="System.String" Scope="User">
-      <Value Profile="(Default)">Data Source=117.25.180.218/orcl;User ID=MES;PassWord=select!#%*(</Value>
-    </Setting>
-    <Setting Name="FolderPath" Type="System.String" Scope="User">
+    <Setting Name="FolderPath" Roaming="true" Type="System.String" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
-    <Setting Name="BackUpFolderPath" Type="System.String" Scope="User">
+    <Setting Name="BackUpFolderPath" Roaming="true" Type="System.String" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
-    <Setting Name="Source" Type="System.String" Scope="User">
+    <Setting Name="Source" Roaming="true" Type="System.String" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
-    <Setting Name="Master" Type="System.String" Scope="User">
+    <Setting Name="Master" Roaming="true" Type="System.String" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
-    <Setting Name="AutoStart" Type="System.Boolean" Scope="User">
+    <Setting Name="AutoStart" Roaming="true" Type="System.Boolean" Scope="User">
       <Value Profile="(Default)">False</Value>
     </Setting>
+    <Setting Name="MES" Roaming="true" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Data Source=117.25.180.218/orcl;User ID=MES;PassWord=select!#%*(</Value>
+    </Setting>
   </Settings>
 </SettingsFile>

+ 5 - 5
UAS_XmlAnalysor/UAS_XmlAnalysor.csproj

@@ -12,9 +12,9 @@
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
-    <TargetFrameworkProfile />
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
     <IsWebBootstrapper>true</IsWebBootstrapper>
-    <PublishUrl>ftp://192.168.253.9/MESSetting/Xml/</PublishUrl>
+    <PublishUrl>E:\s_user_site\Xml\</PublishUrl>
     <Install>true</Install>
     <InstallFrom>Web</InstallFrom>
     <UpdateEnabled>true</UpdateEnabled>
@@ -24,14 +24,14 @@
     <UpdatePeriodically>false</UpdatePeriodically>
     <UpdateRequired>true</UpdateRequired>
     <MapFileExtensions>true</MapFileExtensions>
-    <InstallUrl>http://218.17.158.219:8888/Xml/</InstallUrl>
+    <InstallUrl>http://172.16.11.99/Xml/</InstallUrl>
     <ProductName>UAS_XML解析器</ProductName>
     <PublisherName>深圳市优软科技有限公司</PublisherName>
     <SuiteName>UAS_XML解析器</SuiteName>
     <MinimumRequiredVersion>1.0.0.5</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>10</ApplicationRevision>
+    <ApplicationRevision>16</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>false</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -67,7 +67,7 @@
     <GenerateManifests>true</GenerateManifests>
   </PropertyGroup>
   <PropertyGroup>
-    <SignManifests>true</SignManifests>
+    <SignManifests>false</SignManifests>
   </PropertyGroup>
   <PropertyGroup>
     <ApplicationIcon>Resources\xml_48px_1124003_easyicon.net.ico</ApplicationIcon>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff