فهرست منبع

添加登陆功能

章政 7 سال پیش
والد
کامیت
11b69c8f29

+ 12 - 0
UAS_AutoPass/App.config

@@ -1,6 +1,18 @@
 <?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_AutoPast.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.5.2" />
     </startup>
+    <userSettings>
+        <UAS_AutoPast.Properties.Settings>
+            <setting name="MES" serializeAs="String">
+                <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+            </setting>
+        </UAS_AutoPast.Properties.Settings>
+    </userSettings>
 </configuration>

+ 1 - 1
UAS_AutoPass/AutoAnalysisXml.Designer.cs

@@ -1,4 +1,4 @@
-namespace UAS_XmlAnalysor
+namespace UAS_AutoPass
 {
     partial class AutoAnalysisXml
     {

+ 1 - 2
UAS_AutoPass/AutoAnalysisXml.cs

@@ -6,10 +6,9 @@ using System.IO;
 using System.Threading;
 using System.Windows.Forms;
 using System.Xml;
-using UAS_AutoPass;
 using UAS_AutoPass.ToolClass;
 
-namespace UAS_XmlAnalysor
+namespace UAS_AutoPass
 {
     public partial class AutoAnalysisXml : Form
     {

+ 131 - 0
UAS_AutoPass/Login.Designer.cs

@@ -0,0 +1,131 @@
+namespace UAS_AutoPass
+{
+    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.SuspendLayout();
+            // 
+            // UserName
+            // 
+            this.UserName.Location = new System.Drawing.Point(206, 53);
+            this.UserName.Name = "UserName";
+            this.UserName.Size = new System.Drawing.Size(163, 25);
+            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(122, 51);
+            this.UserName_lable.Name = "UserName_lable";
+            this.UserName_lable.Size = new System.Drawing.Size(72, 27);
+            this.UserName_lable.TabIndex = 4;
+            this.UserName_lable.Text = "用户名";
+            // 
+            // PassWord
+            // 
+            this.PassWord.Location = new System.Drawing.Point(206, 110);
+            this.PassWord.Name = "PassWord";
+            this.PassWord.PasswordChar = '*';
+            this.PassWord.Size = new System.Drawing.Size(163, 25);
+            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(122, 108);
+            this.PassWord_label.Name = "PassWord_label";
+            this.PassWord_label.Size = new System.Drawing.Size(52, 27);
+            this.PassWord_label.TabIndex = 6;
+            this.PassWord_label.Text = "密码";
+            // 
+            // Source
+            // 
+            this.Source.Location = new System.Drawing.Point(206, 169);
+            this.Source.Name = "Source";
+            this.Source.Size = new System.Drawing.Size(163, 25);
+            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(122, 169);
+            this.Source_label.Name = "Source_label";
+            this.Source_label.Size = new System.Drawing.Size(52, 27);
+            this.Source_label.TabIndex = 8;
+            this.Source_label.Text = "资源";
+            // 
+            // CheckLogin
+            // 
+            this.CheckLogin.Location = new System.Drawing.Point(220, 224);
+            this.CheckLogin.Name = "CheckLogin";
+            this.CheckLogin.Size = new System.Drawing.Size(75, 30);
+            this.CheckLogin.TabIndex = 10;
+            this.CheckLogin.Text = "登陆";
+            this.CheckLogin.UseVisualStyleBackColor = true;
+            this.CheckLogin.Click += new System.EventHandler(this.CheckLogin_Click);
+            // 
+            // Login
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(508, 286);
+            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.Name = "Login";
+            this.Text = "Login";
+            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;
+    }
+}

+ 30 - 0
UAS_AutoPass/Login.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Windows.Forms;
+using BenQGuru.eMES.DLLService;
+
+namespace UAS_AutoPass
+{
+    public partial class Login : Form
+    {
+
+        MESHelper helper = new MESHelper();
+
+        public Login()
+        {
+            InitializeComponent();
+        }
+
+        private void CheckLogin_Click(object sender, EventArgs e)
+        {
+            string ErrMessage = "";
+            if (helper.CheckUserAndResourcePassed(UserName.Text, Source.Text, PassWord.Text, out ErrMessage))
+            {
+                AutoAnalysisXml xml = new AutoAnalysisXml();
+                Hide();
+                xml.ShowDialog();
+                Close();
+            }
+            else MessageBox.Show(ErrMessage);
+        }
+    }
+}

+ 1 - 1
UAS_AutoPass/Program.cs

@@ -32,7 +32,7 @@ namespace UAS_AutoPass
                 if (!Directory.Exists(sysdisc + @":\Cache"))
                     Directory.CreateDirectory(sysdisc + @":\Cache");
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
-                    Application.Run(new AutoPassDataCollect());
+                    Application.Run(new Login());
                 else
                 {
                     //创建启动对象

+ 26 - 34
UAS_AutoPass/Properties/Resources.Designer.cs

@@ -1,69 +1,61 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
 //     此代码由工具生成。
-//     运行时版本: 4.0.30319.42000
+//     运行时版本:4.0.30319.42000
 //
-//     对此文件的更改可能导致不正确的行为,如果
-//     重新生成代码,则所做更改将丢失。
+//     对此文件的更改可能导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace UAS_AutoPass.Properties
-{
-
-
+namespace UAS_AutoPass.Properties {
+    using System;
+    
+    
     /// <summary>
-    ///   强类型资源类,用于查找本地化字符串等。
+    ///   一个强类型资源类,用于查找本地化字符串等。
     /// </summary>
     // 此类是由 StronglyTypedResourceBuilder
     // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
-    // 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // 若要添加或除成员,请编辑 .ResX 文件,然后重新运行 ResGen
     // (以 /str 作为命令选项),或重新生成 VS 项目。
     [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    internal class Resources
-    {
-
+    internal class Resources {
+        
         private static global::System.Resources.ResourceManager resourceMan;
-
+        
         private static global::System.Globalization.CultureInfo resourceCulture;
-
+        
         [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
-        internal Resources()
-        {
+        internal Resources() {
         }
-
+        
         /// <summary>
-        ///   返回此类使用的缓存 ResourceManager 实例。
+        ///   返回此类使用的缓存 ResourceManager 实例。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Resources.ResourceManager ResourceManager
-        {
-            get
-            {
-                if ((resourceMan == null))
-                {
-                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UAS_AutoPast.Properties.Resources", typeof(Resources).Assembly);
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UAS_AutoPass.Properties.Resources", typeof(Resources).Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }
-
+        
         /// <summary>
-        ///   覆盖当前线程的 CurrentUICulture 属性
-        ///   使用此强类型的资源类的资源查找
+        ///   使用此强类型资源类,为所有资源查找
+        ///   重写当前线程的 CurrentUICulture 属性
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        internal static global::System.Globalization.CultureInfo Culture
-        {
-            get
-            {
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
                 return resourceCulture;
             }
-            set
-            {
+            set {
                 resourceCulture = value;
             }
         }

+ 27 - 17
UAS_AutoPass/Properties/Settings.Designer.cs

@@ -1,30 +1,40 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     This code was generated by a tool.
-//     Runtime Version:4.0.30319.42000
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
 //
-//     Changes to this file may cause incorrect behavior and will be lost if
-//     the code is regenerated.
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
 // </auto-generated>
 //------------------------------------------------------------------------------
 
-namespace UAS_AutoPass.Properties
-{
-
-
+namespace UAS_AutoPass.Properties {
+    
+    
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
-    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
-    {
-
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+        
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
-        public static Settings Default
-        {
-            get
-            {
+        
+        public static Settings Default {
+            get {
                 return defaultInstance;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
+            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230" +
+            ".200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+            set {
+                this["MES"] = value;
+            }
+        }
     }
 }

+ 8 - 6
UAS_AutoPass/Properties/Settings.settings

@@ -1,7 +1,9 @@
 <?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
-  <Profiles>
-    <Profile Name="(Default)" />
-  </Profiles>
-  <Settings />
-</SettingsFile>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UAS_AutoPast.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="MES" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>

+ 12 - 2
UAS_AutoPass/UAS_AutoPass.csproj

@@ -7,8 +7,8 @@
     <ProjectGuid>{00071CA1-0410-4E55-BC92-2FF6B160C3AC}</ProjectGuid>
     <OutputType>WinExe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>UAS_AutoPast</RootNamespace>
-    <AssemblyName>UAS_AutoPast</AssemblyName>
+    <RootNamespace>UAS_AutoPass</RootNamespace>
+    <AssemblyName>UAS_AutoPass</AssemblyName>
     <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@@ -70,6 +70,12 @@
     <Compile Include="LoadingCircle.Designer.cs">
       <DependentUpon>LoadingCircle.cs</DependentUpon>
     </Compile>
+    <Compile Include="Login.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Login.Designer.cs">
+      <DependentUpon>Login.cs</DependentUpon>
+    </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="SetLoadingWindow.cs">
@@ -86,6 +92,9 @@
     <EmbeddedResource Include="AutoAnalysisXml.resx">
       <DependentUpon>AutoAnalysisXml.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Login.resx">
+      <DependentUpon>Login.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -94,6 +103,7 @@
     <Compile Include="Properties\Resources.Designer.cs">
       <AutoGen>True</AutoGen>
       <DependentUpon>Resources.resx</DependentUpon>
+      <DesignTime>True</DesignTime>
     </Compile>
     <EmbeddedResource Include="SetLoadingWindow.resx">
       <DependentUpon>SetLoadingWindow.cs</DependentUpon>