From 0ae2b7f8a4c85b965852b280d1beff6e2f3d57e4 Mon Sep 17 00:00:00 2001 From: robin Date: Fri, 20 Oct 2017 16:50:24 +0800 Subject: [PATCH] init --- ClientForWEDS.sln | 20 + ClientForWEDS/AxInterop.WEDS4_CommSV2.dll | Bin 0 -> 9216 bytes ClientForWEDS/ClientForWEDS.csproj | 118 ++ ClientForWEDS/Config.txt | 1 + ClientForWEDS/ConfigUtil.cs | 54 + ClientForWEDS/Form1.Designer.cs | 1123 +++++++++++++++++ ClientForWEDS/Form1.cs | 539 ++++++++ ClientForWEDS/Form1.resx | 135 ++ ClientForWEDS/Interop.WEDS4_CommSV2.dll | Bin 0 -> 11264 bytes ClientForWEDS/Program.cs | 18 + ClientForWEDS/Properties/AssemblyInfo.cs | 36 + .../Properties/Resources.Designer.cs | 62 + ClientForWEDS/Properties/Resources.resx | 117 ++ ClientForWEDS/Properties/Settings.Designer.cs | 26 + ClientForWEDS/Properties/Settings.settings | 7 + ClientForWEDS/RpcHelper.cs | 54 + ClientForWEDS/language/Chinese.xml | 134 ++ ClientForWEDS/language/English.xml | 131 ++ ClientForWEDS/ocx/mscomm32.ocx | Bin 0 -> 103744 bytes ClientForWEDS/ocx/mswinsck.ocx | Bin 0 -> 109248 bytes ClientForWEDS/ocx/w4commsv2.ocx | Bin 0 -> 81920 bytes ClientForWEDS/tx.exe | Bin 0 -> 185856 bytes 22 files changed, 2575 insertions(+) create mode 100644 ClientForWEDS.sln create mode 100644 ClientForWEDS/AxInterop.WEDS4_CommSV2.dll create mode 100644 ClientForWEDS/ClientForWEDS.csproj create mode 100644 ClientForWEDS/Config.txt create mode 100644 ClientForWEDS/ConfigUtil.cs create mode 100644 ClientForWEDS/Form1.Designer.cs create mode 100644 ClientForWEDS/Form1.cs create mode 100644 ClientForWEDS/Form1.resx create mode 100644 ClientForWEDS/Interop.WEDS4_CommSV2.dll create mode 100644 ClientForWEDS/Program.cs create mode 100644 ClientForWEDS/Properties/AssemblyInfo.cs create mode 100644 ClientForWEDS/Properties/Resources.Designer.cs create mode 100644 ClientForWEDS/Properties/Resources.resx create mode 100644 ClientForWEDS/Properties/Settings.Designer.cs create mode 100644 ClientForWEDS/Properties/Settings.settings create mode 100644 ClientForWEDS/RpcHelper.cs create mode 100644 ClientForWEDS/language/Chinese.xml create mode 100644 ClientForWEDS/language/English.xml create mode 100644 ClientForWEDS/ocx/mscomm32.ocx create mode 100644 ClientForWEDS/ocx/mswinsck.ocx create mode 100644 ClientForWEDS/ocx/w4commsv2.ocx create mode 100644 ClientForWEDS/tx.exe diff --git a/ClientForWEDS.sln b/ClientForWEDS.sln new file mode 100644 index 0000000..3a075b4 --- /dev/null +++ b/ClientForWEDS.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClientForWEDS", "ClientForWEDS\ClientForWEDS.csproj", "{3C4FECB4-41CA-429E-9688-59D22D4737CB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3C4FECB4-41CA-429E-9688-59D22D4737CB}.Debug|x86.ActiveCfg = Debug|x86 + {3C4FECB4-41CA-429E-9688-59D22D4737CB}.Debug|x86.Build.0 = Debug|x86 + {3C4FECB4-41CA-429E-9688-59D22D4737CB}.Release|x86.ActiveCfg = Release|x86 + {3C4FECB4-41CA-429E-9688-59D22D4737CB}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/ClientForWEDS/AxInterop.WEDS4_CommSV2.dll b/ClientForWEDS/AxInterop.WEDS4_CommSV2.dll new file mode 100644 index 0000000000000000000000000000000000000000..bd41c8c7048cd405b8948d65137bf5c9cbdba11b GIT binary patch literal 9216 zcmeHMeQXuil|Of8{QQLteguO9rH>kjhr|zK8wj-98f*jJ*qGRSBv!g+-g{#+^?NgK zXT}Z&L1{^&QX=}1R_e#LO4Vw&NmM0~(yyqglGScjXv+#Et494$O4U^Th}2e<8dcS9 z*x$Kx=Y9B*uv_)7RmQwC=XcKUo_p`P_nw*e7@PV8=|p7UbNxEew{hodK+3lk=iqLA z=QFMJbmNr`-xi}+HXJ_T1gWC$&H7d$m9<>g3sV_8<j4wgh@ePuW9DSQU-VUfa3i^dI2j-T&z4j5~PSQgVNOie4vDg(xH7a1b+2a2>9e& zm-G+w@w6ZKS-9oc2B7dlt;eV08Xy`-`*z*~QI7REoE+<2_*7g2M0+csRG;I#;^MJs zR7X#4Ci=-rA|b8+chRf)Xj<&T+?%$1SUU}1bT9Mof^Bus2;-^9<~1?l!79RcJPBc zAkJVn8L#M@U!g4|P#*Z&x|MVs57FEs2n9i2+G!?w-DslNASixIOU%~@=Pu%FU1@Mb zY&LO*dtcJW%9T-@sc388(W17v;h|Y#3(UMt*(|rK;cZ1UHuK(Nv)q%)yj$zSWScbo z4EC+Dr3_KojVRCj=)&~d^k5s}H)*HY70Co=56dCf1E-$fG1`KD1YANx(wKHr9`Y)A zdnf;PuTW1Xe%3AYrhC%cdv^Bj1imWsFI)%iU@j(p7Gmp z$2_DRQ=|>}V7?N^cRY!R^TlnkTW~c=9n+%6=rcgi(=(7SLAKHx^n1uA@q4PLEojn2 zf2XmRbe6}Z{DYL&A?v9JAz?QT8cp;$V-fN@koELC*pqZi-5W-dwnEm^Fa}*u8OSC& zRmah;Ncp0auR|tjZG!njkWF+xkxMkuQ&L`rOqeaLsC(D(qDI&D(u6JYAJU!i}1 z&!7_ueGNW?KBmyq@YT`d3Ox&79bHlA1^5#5TZLYNFF`Bb74>%wy(1$Ey(ZCwLa$2{ zC`1}FKdn%Ub}P^~6k02NKTv3sb{l+u0!qm%&U@`^Kou1Cb~>w2qrMN7?h%Dn=%ciTt}3(|sDrL6v|ewgTPd}Pd-xaHEKyOR zZ4y1A(0e5MPl?Xcn0`0fy{6Cy^n38qt!?Hg=V=irdac&wKAS}*`O-1>*U(NTTA~)C zKyn}wbr>h9i#lW!-k-OTNnIuM5j+9zl;{QVJ^eORiQ@{*Axn4AM-{px5uYhp-2ZCw zQ*~UyJ_{-6OH%);)E}4nH*56B^1QTPu8_$D$LW9+^k(|QlJohu;OO*acnxBvpvR=_ zG*~yK>@@1|Y_y28=t%kZkn3p?vYkF8Ef*laMW2*=^~9t{s{O<;Yi(qzE)h2`UU74#aHMHi1{e=Zb*)Q zS;>oHhxj$@?}KD}qln~1aX^?-H^oJ9w-|w(f@H4)JqyYD1?YK5)*n^!qL>#y$4Xrg z8ukRDZeMZ|0?D8rF>D!A4~5q zpszs1(NHVfWo(^v+%?Ds)E)!g4oHEzUI(iI*?{_iN{);sU`e3n3fLN<*Fy?a)@JBf zGstFCPl0;MvXz#@(jw(@>~Re-RzkMXD#)Z9#Y*&s=OSWjsF7>QI2XSuV2bj38K*>x z0qz3t4SZGGo{~0DE3O|&y_)w-+5es~FE^jJ-%EQ=j<})id&Tsz;i1X?=|Qhhm^|8> z&gJv)9qZ2m2MfKdSNdssy5yT4ac8`#-0*_!h6gM+m$&^lb619x{IU6b=wz(`L!ik; z+zRPqj+^uD57PTQzYw6o0WS!t5M(_+?_?B-O6`X1ygh4$HjQUKU}rxOI6dmP_E?UBvdY$jc6iA1 zLurn6wom1pqHKn27h^)KGXZ+Wnvdeex@s615g{idj4#;!VW(irK1zVO(W*$&kQG`} z5r1OdoytoiG`R#4@c1jxAuBu)O-5=J3rtonSGnNi+XZjIt}@9$@lF_5y>Po&S8Za* zovZyL!&hQOtu!H%oV2~zCs-ao#LOZ$4d%T7k?2S=>D~ ziRd<54DpSD#-rQRbeJvX=4jBj!JBm4IU2G)1N+{*Zek-V5>C%jGVuu3A~Os?my;R+Ga;D>JE00)kwK4|6h87n(Sd+k{VqnET{H>b2yIjk5JEguJh4lfq%Q77YD{vxMsGPDXs z!j3za(hgZ8!`>9jFWf5#j^KJiW&Ar;N;3QHC_(lxqRO73w0h#95}NsPw%J`IGMa% zZZKreSjbzns-QE7$ zLD&k=ltFMMKL1G-??^4>M@V(WqqzZ9;q`YMwxQ7dn39Xp8h= z+1};;SH`2Our-fjd>r8f(duZt@u>F7xo{smTAo4FV;n^yj64r-fRRbO>Ii1V77L@> zhX{Ed^Qs}b|Atmu`a^I^+?ENT@@$6@FQiF)e2iqg5-p#iY1p%{iduRI2;H3^7YIS(;#jj6-nk%0a z#9gShp^DFQz0%(B?GoOEOO|jA# zD-E$yA1jGisf!gOR`4<$1;qPsq=;C-w_;di-sX*ZkzB!I(`tM*?CsgsyLJ24Z97xj zcI@uoxw~%{@t7LqDA)6p4{Pnme5-iSb4&H-@ChGpc$mx6yCqMG|6n~;#+BN06+9xm z9{EH0{Fvpq(TkyN%lB1oaeWh|1}dArt-oak`1d@*cON=eO_Q4y6|~mQyaV{$GeGo! z#wfZT(D;|oqd42ski#?qZ3O?*dJuR7a$oenuJo+&yEpioO!>QxAp^WG3WIN5)!%Q} zJcN%xR0~xjt}JogWdBCl>M*<(>Scf`#5K@C-E!HD>q+BPbSYHj;i^7+gGkRwP7mfC z{qfTRIl%8W{7p3Oc?cCPK%Mf@16Q+hKPhnem$)+bD7Ze@Wlle(!HGY}BYu+-$Pm|b z=DHYr9{IAO=L7AblNDYMJ*Mdx@;ijN^dq;?v!?)b6wj?RYG)pQgx{!m%%g}oD + + + Debug + x86 + 8.0.30703 + 2.0 + {3C4FECB4-41CA-429E-9688-59D22D4737CB} + WinExe + Properties + ClientForWEDS + ClientForWEDS + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + .\AxInterop.WEDS4_CommSV2.dll + + + False + E:\BWPB3\tsref\Debug\Forks.JsonRpc.Client.dll + + + False + ..\..\..\..\..\tsref\Debug\Forks.Utils.dll + + + .\Interop.WEDS4_CommSV2.dll + True + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + + Form1.cs + Designer + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + Always + + + Always + + + + + + + + + \ No newline at end of file diff --git a/ClientForWEDS/Config.txt b/ClientForWEDS/Config.txt new file mode 100644 index 0000000..5f28270 --- /dev/null +++ b/ClientForWEDS/Config.txt @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/ClientForWEDS/ConfigUtil.cs b/ClientForWEDS/ConfigUtil.cs new file mode 100644 index 0000000..15b2cb6 --- /dev/null +++ b/ClientForWEDS/ConfigUtil.cs @@ -0,0 +1,54 @@ +using System.IO; +using System.Windows.Forms; +using Forks.Utils.IO; + +namespace ClientForWEDS { + public class ConfigUtil { + public static string ConfigFilePath = Application.StartupPath + "\\Config.txt"; + public static string RdPath = Application.StartupPath + "\\record\\"; + public static void Init() { + using (TextReader reader = FS.OpenReader(ConfigFilePath, true)) { + var nutFile = NutFile.Parse(reader); + + IP1 = nutFile.AsString(ConfigItem.IP1, ""); + IP2 = nutFile.AsString(ConfigItem.IP2, ""); + IP3 = nutFile.AsString(ConfigItem.IP3, ""); + Port = nutFile.AsString(ConfigItem.Port, "3350"); + Timeout = nutFile.AsString(ConfigItem.Timeout, "8000"); + ValidateType = nutFile.AsString(ConfigItem.ValidateType, "no"); + ZDPath = nutFile.AsString(ConfigItem.ZDPath, @"\\updata\wdjl.wds"); + ERPURL = nutFile.AsString(ConfigItem.ERPURL, @"http://"); + UserName = nutFile.AsString(ConfigItem.UserName, ""); + Password = nutFile.AsString(ConfigItem.Password, ""); + } + + } + public static string IP1; + public static string IP2; + public static string IP3; + + public static string Port; + public static string Timeout; + public static string ValidateType; + public static string ZDPath; + + public static string ERPURL; + public static string UserName; + public static string Password; + + public class ConfigItem { + public const string IP1 = "IP1"; + public const string IP2 = "IP2"; + public const string IP3 = "IP3"; + public const string Port = "Port"; + public const string Timeout = "Timeout"; + + public const string ValidateType = "ValidateType"; + public const string ZDPath = "ZDPath"; + public const string ERPURL = "ERPURL"; + public const string UserName = "UserName"; + public const string Password = "Password"; + + } + } +} diff --git a/ClientForWEDS/Form1.Designer.cs b/ClientForWEDS/Form1.Designer.cs new file mode 100644 index 0000000..3ee1747 --- /dev/null +++ b/ClientForWEDS/Form1.Designer.cs @@ -0,0 +1,1123 @@ +namespace ClientForWEDS { + partial class Form1 { + /// + /// 必需的设计器变量。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 清理所有正在使用的资源。 + /// + /// 如果应释放托管资源,为 true;否则为 false。 + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + if (thred != null) + thred.Abort(); + base.Dispose(disposing); + } + + #region Windows 窗体设计器生成的代码 + + /// + /// 设计器支持所需的方法 - 不要 + /// 使用代码编辑器修改此方法的内容。 + /// + private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); + this.axW4commsv21 = new AxWEDS4_CommSV2.AxW4commsv2(); + this.btntpConn = new System.Windows.Forms.Button(); + this.btntpRecive = new System.Windows.Forms.Button(); + this.panel1 = new System.Windows.Forms.Panel(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tpConnection = new System.Windows.Forms.TabPage(); + this.txtReciveZDPath = new System.Windows.Forms.TextBox(); + this.lblRSvFilePath = new System.Windows.Forms.Label(); + this.lblRZdFilePath = new System.Windows.Forms.Label(); + this.btnDisconnection = new System.Windows.Forms.Button(); + this.btnConnection = new System.Windows.Forms.Button(); + this.saveBt = new System.Windows.Forms.Button(); + this.txtValidate = new System.Windows.Forms.TextBox(); + this.rbAdminValidate = new System.Windows.Forms.RadioButton(); + this.rbPassValidate = new System.Windows.Forms.RadioButton(); + this.rbNoValidate = new System.Windows.Forms.RadioButton(); + this.lblValidateString = new System.Windows.Forms.Label(); + this.txtTimeout = new System.Windows.Forms.TextBox(); + this.nudPort = new System.Windows.Forms.NumericUpDown(); + this.lblConnTimeout = new System.Windows.Forms.Label(); + this.lblConnPort = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.txtIP3 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.txtIP2 = new System.Windows.Forms.TextBox(); + this.lblConnIP = new System.Windows.Forms.Label(); + this.txtIP = new System.Windows.Forms.TextBox(); + this.lblLinkParameter = new System.Windows.Forms.Label(); + this.cbLineMd = new System.Windows.Forms.ComboBox(); + this.lblLinkModel = new System.Windows.Forms.Label(); + this.tpReciveFile = new System.Windows.Forms.TabPage(); + this.button1 = new System.Windows.Forms.Button(); + this.lblRZysx1 = new System.Windows.Forms.Label(); + this.lblRZysx = new System.Windows.Forms.Label(); + this.stopButton = new System.Windows.Forms.Button(); + this.btnRecive = new System.Windows.Forms.Button(); + this.label3 = new System.Windows.Forms.Label(); + this.lblRZysx3 = new System.Windows.Forms.Label(); + this.tpSendFile = new System.Windows.Forms.TabPage(); + this.btnSendFile = new System.Windows.Forms.Button(); + this.lblSZysx = new System.Windows.Forms.Label(); + this.lblSZysx2 = new System.Windows.Forms.Label(); + this.lblSZysx1 = new System.Windows.Forms.Label(); + this.txtZdZhaoPianPath = new System.Windows.Forms.TextBox(); + this.lblSZdZhaoPian = new System.Windows.Forms.Label(); + this.lblSZdDangAn = new System.Windows.Forms.Label(); + this.txtZdDangAnPath = new System.Windows.Forms.TextBox(); + this.lblSZdPath = new System.Windows.Forms.Label(); + this.lblSSvPath = new System.Windows.Forms.Label(); + this.btnSaveFileZhaoPian = new System.Windows.Forms.Button(); + this.txtSvZhaoPianPath = new System.Windows.Forms.TextBox(); + this.lblSSvZhaoPian = new System.Windows.Forms.Label(); + this.btnSaveFileDangAn = new System.Windows.Forms.Button(); + this.txtSvDangAnPath = new System.Windows.Forms.TextBox(); + this.lblSSvDangAn = new System.Windows.Forms.Label(); + this.tpReciveFromAny = new System.Windows.Forms.TabPage(); + this.cbCloseTX = new System.Windows.Forms.CheckBox(); + this.cbShowTX = new System.Windows.Forms.CheckBox(); + this.btnStartTx = new System.Windows.Forms.Button(); + this.txtEndIp = new System.Windows.Forms.TextBox(); + this.txtStartIP = new System.Windows.Forms.TextBox(); + this.lblEndIP = new System.Windows.Forms.Label(); + this.lblStartIP = new System.Windows.Forms.Label(); + this.lblRAZysx3 = new System.Windows.Forms.Label(); + this.lblRAZysx2 = new System.Windows.Forms.Label(); + this.lblRAZysx1 = new System.Windows.Forms.Label(); + this.lblRAJilu = new System.Windows.Forms.Label(); + this.lblRAZysx = new System.Windows.Forms.Label(); + this.lblReciveAll = new System.Windows.Forms.Label(); + this.lblZdUdpData = new System.Windows.Forms.Label(); + this.txtUDP = new System.Windows.Forms.RichTextBox(); + this.txtLog = new System.Windows.Forms.RichTextBox(); + this.lblState = new System.Windows.Forms.Label(); + this.lblZdLinked = new System.Windows.Forms.Label(); + this.lblZdLinkStateInfo = new System.Windows.Forms.Label(); + this.saveFileDialogRecive = new System.Windows.Forms.SaveFileDialog(); + this.erpTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.userTextBox = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.passTextBox = new System.Windows.Forms.TextBox(); + this.label7 = new System.Windows.Forms.Label(); + this.button2 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.openFileDialogDangAn = new System.Windows.Forms.OpenFileDialog(); + ((System.ComponentModel.ISupportInitialize)(this.axW4commsv21)).BeginInit(); + this.panel1.SuspendLayout(); + this.tabControl1.SuspendLayout(); + this.tpConnection.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudPort)).BeginInit(); + this.tpReciveFile.SuspendLayout(); + this.tpSendFile.SuspendLayout(); + this.tpReciveFromAny.SuspendLayout(); + this.SuspendLayout(); + // + // axW4commsv21 + // + this.axW4commsv21.Enabled = true; + this.axW4commsv21.Location = new System.Drawing.Point(2, 6); + this.axW4commsv21.Name = "axW4commsv21"; + this.axW4commsv21.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axW4commsv21.OcxState"))); + this.axW4commsv21.Size = new System.Drawing.Size(167, 26); + this.axW4commsv21.TabIndex = 0; + this.axW4commsv21.InfoZdEvent += new AxWEDS4_CommSV2.@__W4commsv2_InfoZdEventHandler(this.axW4commsv21_InfoZdEvent); + this.axW4commsv21.OnEvent += new System.EventHandler(this.axW4commsv21_OnEvent); + this.axW4commsv21.LineZdEvent += new System.EventHandler(this.axW4commsv21_LineZdEvent); + // + // btntpConn + // + this.btntpConn.Location = new System.Drawing.Point(2, 35); + this.btntpConn.Name = "btntpConn"; + this.btntpConn.Size = new System.Drawing.Size(167, 45); + this.btntpConn.TabIndex = 9; + this.btntpConn.Text = "基础设置"; + this.btntpConn.UseVisualStyleBackColor = true; + // + // btntpRecive + // + this.btntpRecive.Location = new System.Drawing.Point(2, 86); + this.btntpRecive.Name = "btntpRecive"; + this.btntpRecive.Size = new System.Drawing.Size(167, 45); + this.btntpRecive.TabIndex = 10; + this.btntpRecive.Text = "采集考勤到PC"; + this.btntpRecive.UseVisualStyleBackColor = true; + // + // panel1 + // + this.panel1.Controls.Add(this.tabControl1); + this.panel1.Location = new System.Drawing.Point(175, 3); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(454, 443); + this.panel1.TabIndex = 11; + // + // tabControl1 + // + this.tabControl1.Alignment = System.Windows.Forms.TabAlignment.Bottom; + this.tabControl1.Controls.Add(this.tpConnection); + this.tabControl1.Controls.Add(this.tpReciveFile); + this.tabControl1.Controls.Add(this.tpSendFile); + this.tabControl1.Controls.Add(this.tpReciveFromAny); + this.tabControl1.Location = new System.Drawing.Point(3, 3); + this.tabControl1.Multiline = true; + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(451, 479); + this.tabControl1.TabIndex = 1; + // + // tpConnection + // + this.tpConnection.Controls.Add(this.passTextBox); + this.tpConnection.Controls.Add(this.userTextBox); + this.tpConnection.Controls.Add(this.erpTextBox); + this.tpConnection.Controls.Add(this.txtReciveZDPath); + this.tpConnection.Controls.Add(this.lblRSvFilePath); + this.tpConnection.Controls.Add(this.lblRZdFilePath); + this.tpConnection.Controls.Add(this.btnDisconnection); + this.tpConnection.Controls.Add(this.btnConnection); + this.tpConnection.Controls.Add(this.saveBt); + this.tpConnection.Controls.Add(this.txtValidate); + this.tpConnection.Controls.Add(this.rbAdminValidate); + this.tpConnection.Controls.Add(this.rbPassValidate); + this.tpConnection.Controls.Add(this.rbNoValidate); + this.tpConnection.Controls.Add(this.lblValidateString); + this.tpConnection.Controls.Add(this.txtTimeout); + this.tpConnection.Controls.Add(this.nudPort); + this.tpConnection.Controls.Add(this.lblConnTimeout); + this.tpConnection.Controls.Add(this.lblConnPort); + this.tpConnection.Controls.Add(this.label2); + this.tpConnection.Controls.Add(this.txtIP3); + this.tpConnection.Controls.Add(this.label6); + this.tpConnection.Controls.Add(this.label1); + this.tpConnection.Controls.Add(this.label5); + this.tpConnection.Controls.Add(this.txtIP2); + this.tpConnection.Controls.Add(this.label4); + this.tpConnection.Controls.Add(this.lblConnIP); + this.tpConnection.Controls.Add(this.txtIP); + this.tpConnection.Controls.Add(this.lblLinkParameter); + this.tpConnection.Controls.Add(this.cbLineMd); + this.tpConnection.Controls.Add(this.lblLinkModel); + this.tpConnection.Location = new System.Drawing.Point(4, 4); + this.tpConnection.Name = "tpConnection"; + this.tpConnection.Padding = new System.Windows.Forms.Padding(3); + this.tpConnection.Size = new System.Drawing.Size(443, 453); + this.tpConnection.TabIndex = 0; + this.tpConnection.Text = "终端连接/断开"; + this.tpConnection.UseVisualStyleBackColor = true; + // + // txtReciveZDPath + // + this.txtReciveZDPath.Location = new System.Drawing.Point(70, 287); + this.txtReciveZDPath.Name = "txtReciveZDPath"; + this.txtReciveZDPath.Size = new System.Drawing.Size(262, 21); + this.txtReciveZDPath.TabIndex = 30; + this.txtReciveZDPath.Text = "\\\\updata\\wdjl.wds"; + // + // lblRSvFilePath + // + this.lblRSvFilePath.AutoSize = true; + this.lblRSvFilePath.Location = new System.Drawing.Point(6, 319); + this.lblRSvFilePath.Name = "lblRSvFilePath"; + this.lblRSvFilePath.Size = new System.Drawing.Size(65, 12); + this.lblRSvFilePath.TabIndex = 28; + this.lblRSvFilePath.Text = "5.ERP系统:\r\n"; + this.lblRSvFilePath.Visible = false; + // + // lblRZdFilePath + // + this.lblRZdFilePath.AutoSize = true; + this.lblRZdFilePath.Location = new System.Drawing.Point(6, 255); + this.lblRZdFilePath.Name = "lblRZdFilePath"; + this.lblRZdFilePath.Size = new System.Drawing.Size(239, 12); + this.lblRZdFilePath.TabIndex = 27; + this.lblRZdFilePath.Text = "4.终端文件路径(一般为默认值不用修改):"; + // + // btnDisconnection + // + this.btnDisconnection.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnDisconnection.Location = new System.Drawing.Point(252, 405); + this.btnDisconnection.Name = "btnDisconnection"; + this.btnDisconnection.Size = new System.Drawing.Size(75, 23); + this.btnDisconnection.TabIndex = 26; + this.btnDisconnection.Text = "断开连接"; + this.btnDisconnection.UseVisualStyleBackColor = true; + this.btnDisconnection.Click += new System.EventHandler(this.btnDisconnection_Click); + // + // btnConnection + // + this.btnConnection.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnConnection.Location = new System.Drawing.Point(169, 405); + this.btnConnection.Name = "btnConnection"; + this.btnConnection.Size = new System.Drawing.Size(75, 23); + this.btnConnection.TabIndex = 26; + this.btnConnection.Text = "测试连接"; + this.btnConnection.UseVisualStyleBackColor = true; + this.btnConnection.Click += new System.EventHandler(this.btnConnection_Click); + // + // saveBt + // + this.saveBt.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.saveBt.Location = new System.Drawing.Point(79, 405); + this.saveBt.Name = "saveBt"; + this.saveBt.Size = new System.Drawing.Size(75, 23); + this.saveBt.TabIndex = 24; + this.saveBt.Text = "保存"; + this.saveBt.UseVisualStyleBackColor = true; + this.saveBt.Click += new System.EventHandler(this.saveBt_Click); + // + // txtValidate + // + this.txtValidate.Location = new System.Drawing.Point(231, 179); + this.txtValidate.Multiline = true; + this.txtValidate.Name = "txtValidate"; + this.txtValidate.Size = new System.Drawing.Size(147, 65); + this.txtValidate.TabIndex = 23; + this.txtValidate.Text = "id=\r\ncard=\r\npassword=\r\nline="; + // + // rbAdminValidate + // + this.rbAdminValidate.AutoSize = true; + this.rbAdminValidate.Location = new System.Drawing.Point(129, 223); + this.rbAdminValidate.Name = "rbAdminValidate"; + this.rbAdminValidate.Size = new System.Drawing.Size(83, 16); + this.rbAdminValidate.TabIndex = 22; + this.rbAdminValidate.TabStop = true; + this.rbAdminValidate.Text = "管理员验证"; + this.rbAdminValidate.UseVisualStyleBackColor = true; + this.rbAdminValidate.CheckedChanged += new System.EventHandler(this.rbValidate_Checked); + // + // rbPassValidate + // + this.rbPassValidate.AutoSize = true; + this.rbPassValidate.Location = new System.Drawing.Point(129, 202); + this.rbPassValidate.Name = "rbPassValidate"; + this.rbPassValidate.Size = new System.Drawing.Size(71, 16); + this.rbPassValidate.TabIndex = 21; + this.rbPassValidate.TabStop = true; + this.rbPassValidate.Text = "密码验证"; + this.rbPassValidate.UseVisualStyleBackColor = true; + this.rbPassValidate.CheckedChanged += new System.EventHandler(this.rbValidate_Checked); + // + // rbNoValidate + // + this.rbNoValidate.AutoSize = true; + this.rbNoValidate.Location = new System.Drawing.Point(129, 180); + this.rbNoValidate.Name = "rbNoValidate"; + this.rbNoValidate.Size = new System.Drawing.Size(59, 16); + this.rbNoValidate.TabIndex = 20; + this.rbNoValidate.TabStop = true; + this.rbNoValidate.Text = "不验证"; + this.rbNoValidate.UseVisualStyleBackColor = true; + this.rbNoValidate.CheckedChanged += new System.EventHandler(this.rbValidate_Checked); + // + // lblValidateString + // + this.lblValidateString.AutoSize = true; + this.lblValidateString.Location = new System.Drawing.Point(6, 179); + this.lblValidateString.Name = "lblValidateString"; + this.lblValidateString.Size = new System.Drawing.Size(95, 12); + this.lblValidateString.TabIndex = 19; + this.lblValidateString.Text = "3.连接验证字串:\r\n"; + // + // txtTimeout + // + this.txtTimeout.Location = new System.Drawing.Point(299, 106); + this.txtTimeout.Name = "txtTimeout"; + this.txtTimeout.Size = new System.Drawing.Size(120, 21); + this.txtTimeout.TabIndex = 8; + this.txtTimeout.Text = "8000"; + // + // nudPort + // + this.nudPort.Location = new System.Drawing.Point(299, 72); + this.nudPort.Maximum = new decimal(new int[] { + 65535, + 0, + 0, + 0}); + this.nudPort.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nudPort.Name = "nudPort"; + this.nudPort.Size = new System.Drawing.Size(120, 21); + this.nudPort.TabIndex = 7; + this.nudPort.Value = new decimal(new int[] { + 3350, + 0, + 0, + 0}); + // + // lblConnTimeout + // + this.lblConnTimeout.Location = new System.Drawing.Point(233, 107); + this.lblConnTimeout.Name = "lblConnTimeout"; + this.lblConnTimeout.Size = new System.Drawing.Size(60, 12); + this.lblConnTimeout.TabIndex = 6; + this.lblConnTimeout.Text = "超时时间:"; + this.lblConnTimeout.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // lblConnPort + // + this.lblConnPort.Location = new System.Drawing.Point(229, 75); + this.lblConnPort.Name = "lblConnPort"; + this.lblConnPort.Size = new System.Drawing.Size(64, 12); + this.lblConnPort.TabIndex = 5; + this.lblConnPort.Text = "端 口 号:"; + this.lblConnPort.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // label2 + // + this.label2.Location = new System.Drawing.Point(43, 139); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(58, 14); + this.label2.TabIndex = 4; + this.label2.Text = "IP地址:"; + this.label2.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtIP3 + // + this.txtIP3.Location = new System.Drawing.Point(107, 136); + this.txtIP3.Name = "txtIP3"; + this.txtIP3.Size = new System.Drawing.Size(120, 21); + this.txtIP3.TabIndex = 5; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(43, 107); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(58, 14); + this.label1.TabIndex = 4; + this.label1.Text = "IP地址:"; + this.label1.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtIP2 + // + this.txtIP2.Location = new System.Drawing.Point(107, 104); + this.txtIP2.Name = "txtIP2"; + this.txtIP2.Size = new System.Drawing.Size(120, 21); + this.txtIP2.TabIndex = 4; + // + // lblConnIP + // + this.lblConnIP.Location = new System.Drawing.Point(43, 75); + this.lblConnIP.Name = "lblConnIP"; + this.lblConnIP.Size = new System.Drawing.Size(58, 14); + this.lblConnIP.TabIndex = 4; + this.lblConnIP.Text = "IP地址:"; + this.lblConnIP.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtIP + // + this.txtIP.Location = new System.Drawing.Point(107, 71); + this.txtIP.Name = "txtIP"; + this.txtIP.Size = new System.Drawing.Size(120, 21); + this.txtIP.TabIndex = 3; + this.txtIP.Text = "192.168.1.101"; + // + // lblLinkParameter + // + this.lblLinkParameter.AutoSize = true; + this.lblLinkParameter.Location = new System.Drawing.Point(6, 45); + this.lblLinkParameter.Name = "lblLinkParameter"; + this.lblLinkParameter.Size = new System.Drawing.Size(95, 12); + this.lblLinkParameter.TabIndex = 2; + this.lblLinkParameter.Text = "2.终端基本参数:\r\n"; + // + // cbLineMd + // + this.cbLineMd.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbLineMd.FormattingEnabled = true; + this.cbLineMd.Items.AddRange(new object[] { + "以太网通讯(TCP/IP)"}); + this.cbLineMd.Location = new System.Drawing.Point(129, 3); + this.cbLineMd.Name = "cbLineMd"; + this.cbLineMd.Size = new System.Drawing.Size(227, 20); + this.cbLineMd.TabIndex = 1; + // + // lblLinkModel + // + this.lblLinkModel.AutoSize = true; + this.lblLinkModel.Location = new System.Drawing.Point(6, 6); + this.lblLinkModel.Name = "lblLinkModel"; + this.lblLinkModel.Size = new System.Drawing.Size(95, 12); + this.lblLinkModel.TabIndex = 0; + this.lblLinkModel.Text = "1.连接网络模式:"; + // + // tpReciveFile + // + this.tpReciveFile.Controls.Add(this.label7); + this.tpReciveFile.Controls.Add(this.button2); + this.tpReciveFile.Controls.Add(this.textBox1); + this.tpReciveFile.Controls.Add(this.label8); + this.tpReciveFile.Controls.Add(this.button1); + this.tpReciveFile.Controls.Add(this.lblRZysx1); + this.tpReciveFile.Controls.Add(this.lblRZysx); + this.tpReciveFile.Controls.Add(this.stopButton); + this.tpReciveFile.Controls.Add(this.btnRecive); + this.tpReciveFile.Controls.Add(this.label3); + this.tpReciveFile.Controls.Add(this.lblRZysx3); + this.tpReciveFile.Location = new System.Drawing.Point(4, 4); + this.tpReciveFile.Name = "tpReciveFile"; + this.tpReciveFile.Padding = new System.Windows.Forms.Padding(3); + this.tpReciveFile.Size = new System.Drawing.Size(443, 453); + this.tpReciveFile.TabIndex = 1; + this.tpReciveFile.Text = "终端文件读取到PC"; + this.tpReciveFile.UseVisualStyleBackColor = true; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(184, 356); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 14; + this.button1.Text = "手工导入"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // lblRZysx1 + // + this.lblRZysx1.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblRZysx1.Location = new System.Drawing.Point(42, 48); + this.lblRZysx1.Name = "lblRZysx1"; + this.lblRZysx1.Size = new System.Drawing.Size(323, 38); + this.lblRZysx1.TabIndex = 13; + this.lblRZysx1.Text = "1.定时每10分钟采集一次考勤记录"; + // + // lblRZysx + // + this.lblRZysx.AutoSize = true; + this.lblRZysx.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblRZysx.Location = new System.Drawing.Point(39, 30); + this.lblRZysx.Name = "lblRZysx"; + this.lblRZysx.Size = new System.Drawing.Size(57, 12); + this.lblRZysx.TabIndex = 12; + this.lblRZysx.Text = "注意事项"; + // + // stopButton + // + this.stopButton.Location = new System.Drawing.Point(237, 204); + this.stopButton.Name = "stopButton"; + this.stopButton.Size = new System.Drawing.Size(75, 23); + this.stopButton.TabIndex = 11; + this.stopButton.Text = "停止采集"; + this.stopButton.UseVisualStyleBackColor = true; + this.stopButton.Click += new System.EventHandler(this.stopButton_Click); + // + // btnRecive + // + this.btnRecive.Location = new System.Drawing.Point(130, 204); + this.btnRecive.Name = "btnRecive"; + this.btnRecive.Size = new System.Drawing.Size(75, 23); + this.btnRecive.TabIndex = 11; + this.btnRecive.Text = "开始采集"; + this.btnRecive.UseVisualStyleBackColor = true; + this.btnRecive.Click += new System.EventHandler(this.btnRecive_Click); + // + // label3 + // + this.label3.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label3.Location = new System.Drawing.Point(42, 135); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(303, 33); + this.label3.TabIndex = 10; + this.label3.Text = "3.考勤记录里的员工编号需要在ERP系统做对照"; + // + // lblRZysx3 + // + this.lblRZysx3.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblRZysx3.Location = new System.Drawing.Point(42, 91); + this.lblRZysx3.Name = "lblRZysx3"; + this.lblRZysx3.Size = new System.Drawing.Size(303, 33); + this.lblRZysx3.TabIndex = 10; + this.lblRZysx3.Text = "2.考勤记录采集成功后以文本保存到record文件夹"; + // + // tpSendFile + // + this.tpSendFile.Controls.Add(this.btnSendFile); + this.tpSendFile.Controls.Add(this.lblSZysx); + this.tpSendFile.Controls.Add(this.lblSZysx2); + this.tpSendFile.Controls.Add(this.lblSZysx1); + this.tpSendFile.Controls.Add(this.txtZdZhaoPianPath); + this.tpSendFile.Controls.Add(this.lblSZdZhaoPian); + this.tpSendFile.Controls.Add(this.lblSZdDangAn); + this.tpSendFile.Controls.Add(this.txtZdDangAnPath); + this.tpSendFile.Controls.Add(this.lblSZdPath); + this.tpSendFile.Controls.Add(this.lblSSvPath); + this.tpSendFile.Controls.Add(this.btnSaveFileZhaoPian); + this.tpSendFile.Controls.Add(this.txtSvZhaoPianPath); + this.tpSendFile.Controls.Add(this.lblSSvZhaoPian); + this.tpSendFile.Controls.Add(this.btnSaveFileDangAn); + this.tpSendFile.Controls.Add(this.txtSvDangAnPath); + this.tpSendFile.Controls.Add(this.lblSSvDangAn); + this.tpSendFile.Location = new System.Drawing.Point(4, 4); + this.tpSendFile.Name = "tpSendFile"; + this.tpSendFile.Padding = new System.Windows.Forms.Padding(3); + this.tpSendFile.Size = new System.Drawing.Size(443, 453); + this.tpSendFile.TabIndex = 2; + this.tpSendFile.Text = "PC文件写入到终端"; + this.tpSendFile.UseVisualStyleBackColor = true; + // + // btnSendFile + // + this.btnSendFile.Location = new System.Drawing.Point(333, 337); + this.btnSendFile.Name = "btnSendFile"; + this.btnSendFile.Size = new System.Drawing.Size(75, 23); + this.btnSendFile.TabIndex = 24; + this.btnSendFile.Text = "文件传输"; + this.btnSendFile.UseVisualStyleBackColor = true; + // + // lblSZysx + // + this.lblSZysx.AutoSize = true; + this.lblSZysx.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblSZysx.Location = new System.Drawing.Point(45, 215); + this.lblSZysx.Name = "lblSZysx"; + this.lblSZysx.Size = new System.Drawing.Size(57, 12); + this.lblSZysx.TabIndex = 23; + this.lblSZysx.Text = "注意事项"; + // + // lblSZysx2 + // + this.lblSZysx2.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblSZysx2.Location = new System.Drawing.Point(44, 286); + this.lblSZysx2.Name = "lblSZysx2"; + this.lblSZysx2.Size = new System.Drawing.Size(328, 49); + this.lblSZysx2.TabIndex = 22; + this.lblSZysx2.Text = "2.写入档案及照片指纹文件到终端时,先写照片指纹成功后再写入档案"; + // + // lblSZysx1 + // + this.lblSZysx1.Font = new System.Drawing.Font("宋体", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblSZysx1.Location = new System.Drawing.Point(44, 235); + this.lblSZysx1.Name = "lblSZysx1"; + this.lblSZysx1.Size = new System.Drawing.Size(328, 49); + this.lblSZysx1.TabIndex = 22; + this.lblSZysx1.Text = "1.请勿随意传输非法文件充当档案及照片,终端可能因无法加载而造成异常"; + // + // txtZdZhaoPianPath + // + this.txtZdZhaoPianPath.Location = new System.Drawing.Point(104, 169); + this.txtZdZhaoPianPath.Name = "txtZdZhaoPianPath"; + this.txtZdZhaoPianPath.Size = new System.Drawing.Size(268, 21); + this.txtZdZhaoPianPath.TabIndex = 21; + this.txtZdZhaoPianPath.Text = "\\\\updata\\wdjl.wds"; + // + // lblSZdZhaoPian + // + this.lblSZdZhaoPian.Location = new System.Drawing.Point(6, 172); + this.lblSZdZhaoPian.Name = "lblSZdZhaoPian"; + this.lblSZdZhaoPian.Size = new System.Drawing.Size(92, 12); + this.lblSZdZhaoPian.TabIndex = 20; + this.lblSZdZhaoPian.Text = "照片路径"; + this.lblSZdZhaoPian.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // lblSZdDangAn + // + this.lblSZdDangAn.Location = new System.Drawing.Point(6, 145); + this.lblSZdDangAn.Name = "lblSZdDangAn"; + this.lblSZdDangAn.Size = new System.Drawing.Size(92, 12); + this.lblSZdDangAn.TabIndex = 19; + this.lblSZdDangAn.Text = "档案路径"; + this.lblSZdDangAn.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // txtZdDangAnPath + // + this.txtZdDangAnPath.Location = new System.Drawing.Point(104, 142); + this.txtZdDangAnPath.Name = "txtZdDangAnPath"; + this.txtZdDangAnPath.Size = new System.Drawing.Size(268, 21); + this.txtZdDangAnPath.TabIndex = 18; + this.txtZdDangAnPath.Text = "\\\\updata\\wdjl.wds"; + // + // lblSZdPath + // + this.lblSZdPath.AutoSize = true; + this.lblSZdPath.Location = new System.Drawing.Point(28, 118); + this.lblSZdPath.Name = "lblSZdPath"; + this.lblSZdPath.Size = new System.Drawing.Size(119, 12); + this.lblSZdPath.TabIndex = 17; + this.lblSZdPath.Text = "2.终端文件存放路径:\r\n"; + // + // lblSSvPath + // + this.lblSSvPath.AutoSize = true; + this.lblSSvPath.Location = new System.Drawing.Point(28, 25); + this.lblSSvPath.Name = "lblSSvPath"; + this.lblSSvPath.Size = new System.Drawing.Size(107, 12); + this.lblSSvPath.TabIndex = 16; + this.lblSSvPath.Text = "1.服务器文件路径:"; + // + // btnSaveFileZhaoPian + // + this.btnSaveFileZhaoPian.Location = new System.Drawing.Point(345, 80); + this.btnSaveFileZhaoPian.Name = "btnSaveFileZhaoPian"; + this.btnSaveFileZhaoPian.Size = new System.Drawing.Size(27, 23); + this.btnSaveFileZhaoPian.TabIndex = 15; + this.btnSaveFileZhaoPian.Text = "…"; + this.btnSaveFileZhaoPian.UseVisualStyleBackColor = true; + // + // txtSvZhaoPianPath + // + this.txtSvZhaoPianPath.Location = new System.Drawing.Point(104, 82); + this.txtSvZhaoPianPath.Name = "txtSvZhaoPianPath"; + this.txtSvZhaoPianPath.ReadOnly = true; + this.txtSvZhaoPianPath.Size = new System.Drawing.Size(235, 21); + this.txtSvZhaoPianPath.TabIndex = 14; + // + // lblSSvZhaoPian + // + this.lblSSvZhaoPian.Location = new System.Drawing.Point(6, 85); + this.lblSSvZhaoPian.Name = "lblSSvZhaoPian"; + this.lblSSvZhaoPian.Size = new System.Drawing.Size(92, 12); + this.lblSSvZhaoPian.TabIndex = 13; + this.lblSSvZhaoPian.Text = "照片路径"; + this.lblSSvZhaoPian.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // btnSaveFileDangAn + // + this.btnSaveFileDangAn.Location = new System.Drawing.Point(345, 53); + this.btnSaveFileDangAn.Name = "btnSaveFileDangAn"; + this.btnSaveFileDangAn.Size = new System.Drawing.Size(27, 23); + this.btnSaveFileDangAn.TabIndex = 12; + this.btnSaveFileDangAn.Text = "…"; + this.btnSaveFileDangAn.UseVisualStyleBackColor = true; + // + // txtSvDangAnPath + // + this.txtSvDangAnPath.Location = new System.Drawing.Point(104, 55); + this.txtSvDangAnPath.Name = "txtSvDangAnPath"; + this.txtSvDangAnPath.ReadOnly = true; + this.txtSvDangAnPath.Size = new System.Drawing.Size(235, 21); + this.txtSvDangAnPath.TabIndex = 11; + // + // lblSSvDangAn + // + this.lblSSvDangAn.Location = new System.Drawing.Point(6, 58); + this.lblSSvDangAn.Name = "lblSSvDangAn"; + this.lblSSvDangAn.Size = new System.Drawing.Size(92, 12); + this.lblSSvDangAn.TabIndex = 10; + this.lblSSvDangAn.Text = "档案路径"; + this.lblSSvDangAn.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // tpReciveFromAny + // + this.tpReciveFromAny.Controls.Add(this.cbCloseTX); + this.tpReciveFromAny.Controls.Add(this.cbShowTX); + this.tpReciveFromAny.Controls.Add(this.btnStartTx); + this.tpReciveFromAny.Controls.Add(this.txtEndIp); + this.tpReciveFromAny.Controls.Add(this.txtStartIP); + this.tpReciveFromAny.Controls.Add(this.lblEndIP); + this.tpReciveFromAny.Controls.Add(this.lblStartIP); + this.tpReciveFromAny.Controls.Add(this.lblRAZysx3); + this.tpReciveFromAny.Controls.Add(this.lblRAZysx2); + this.tpReciveFromAny.Controls.Add(this.lblRAZysx1); + this.tpReciveFromAny.Controls.Add(this.lblRAJilu); + this.tpReciveFromAny.Controls.Add(this.lblRAZysx); + this.tpReciveFromAny.Controls.Add(this.lblReciveAll); + this.tpReciveFromAny.Location = new System.Drawing.Point(4, 4); + this.tpReciveFromAny.Name = "tpReciveFromAny"; + this.tpReciveFromAny.Padding = new System.Windows.Forms.Padding(3); + this.tpReciveFromAny.Size = new System.Drawing.Size(443, 453); + this.tpReciveFromAny.TabIndex = 6; + this.tpReciveFromAny.Text = "同时多台终端通讯"; + this.tpReciveFromAny.UseVisualStyleBackColor = true; + // + // cbCloseTX + // + this.cbCloseTX.AutoSize = true; + this.cbCloseTX.Checked = true; + this.cbCloseTX.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbCloseTX.Location = new System.Drawing.Point(96, 137); + this.cbCloseTX.Name = "cbCloseTX"; + this.cbCloseTX.Size = new System.Drawing.Size(144, 16); + this.cbCloseTX.TabIndex = 8; + this.cbCloseTX.Text = "是否自动关闭通讯窗体"; + this.cbCloseTX.UseVisualStyleBackColor = true; + // + // cbShowTX + // + this.cbShowTX.AutoSize = true; + this.cbShowTX.Location = new System.Drawing.Point(96, 115); + this.cbShowTX.Name = "cbShowTX"; + this.cbShowTX.Size = new System.Drawing.Size(120, 16); + this.cbShowTX.TabIndex = 7; + this.cbShowTX.Text = "是否显示通讯窗体"; + this.cbShowTX.UseVisualStyleBackColor = true; + // + // btnStartTx + // + this.btnStartTx.Location = new System.Drawing.Point(300, 337); + this.btnStartTx.Name = "btnStartTx"; + this.btnStartTx.Size = new System.Drawing.Size(108, 23); + this.btnStartTx.TabIndex = 4; + this.btnStartTx.Text = "开始并发采集"; + this.btnStartTx.UseVisualStyleBackColor = true; + // + // txtEndIp + // + this.txtEndIp.Location = new System.Drawing.Point(163, 76); + this.txtEndIp.Name = "txtEndIp"; + this.txtEndIp.Size = new System.Drawing.Size(154, 21); + this.txtEndIp.TabIndex = 2; + // + // txtStartIP + // + this.txtStartIP.Location = new System.Drawing.Point(163, 44); + this.txtStartIP.Name = "txtStartIP"; + this.txtStartIP.Size = new System.Drawing.Size(154, 21); + this.txtStartIP.TabIndex = 2; + // + // lblEndIP + // + this.lblEndIP.Location = new System.Drawing.Point(6, 79); + this.lblEndIP.Name = "lblEndIP"; + this.lblEndIP.Size = new System.Drawing.Size(151, 12); + this.lblEndIP.TabIndex = 1; + this.lblEndIP.Text = "终止IP地址"; + this.lblEndIP.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // lblStartIP + // + this.lblStartIP.Location = new System.Drawing.Point(6, 47); + this.lblStartIP.Name = "lblStartIP"; + this.lblStartIP.Size = new System.Drawing.Size(151, 12); + this.lblStartIP.TabIndex = 1; + this.lblStartIP.Text = "起始IP地址"; + this.lblStartIP.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // lblRAZysx3 + // + this.lblRAZysx3.Location = new System.Drawing.Point(46, 290); + this.lblRAZysx3.Name = "lblRAZysx3"; + this.lblRAZysx3.Size = new System.Drawing.Size(351, 44); + this.lblRAZysx3.TabIndex = 1; + this.lblRAZysx3.Text = "3.本例只作演示,且勿并发过多"; + // + // lblRAZysx2 + // + this.lblRAZysx2.Location = new System.Drawing.Point(46, 240); + this.lblRAZysx2.Name = "lblRAZysx2"; + this.lblRAZysx2.Size = new System.Drawing.Size(351, 44); + this.lblRAZysx2.TabIndex = 1; + this.lblRAZysx2.Text = "2.记录文件存放路径为 ..\\Data\\终端IP地址.wds"; + // + // lblRAZysx1 + // + this.lblRAZysx1.Location = new System.Drawing.Point(46, 190); + this.lblRAZysx1.Name = "lblRAZysx1"; + this.lblRAZysx1.Size = new System.Drawing.Size(351, 44); + this.lblRAZysx1.TabIndex = 1; + this.lblRAZysx1.Text = "1.该实例采用多进程模式,调用多个实例完成"; + // + // lblRAJilu + // + this.lblRAJilu.AutoSize = true; + this.lblRAJilu.Location = new System.Drawing.Point(209, 18); + this.lblRAJilu.Name = "lblRAJilu"; + this.lblRAJilu.Size = new System.Drawing.Size(89, 12); + this.lblRAJilu.TabIndex = 1; + this.lblRAJilu.Text = "以采集记录为例"; + // + // lblRAZysx + // + this.lblRAZysx.AutoSize = true; + this.lblRAZysx.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblRAZysx.Location = new System.Drawing.Point(21, 164); + this.lblRAZysx.Name = "lblRAZysx"; + this.lblRAZysx.Size = new System.Drawing.Size(57, 12); + this.lblRAZysx.TabIndex = 0; + this.lblRAZysx.Text = "注意事项"; + // + // lblReciveAll + // + this.lblReciveAll.AutoSize = true; + this.lblReciveAll.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblReciveAll.Location = new System.Drawing.Point(21, 18); + this.lblReciveAll.Name = "lblReciveAll"; + this.lblReciveAll.Size = new System.Drawing.Size(109, 12); + this.lblReciveAll.TabIndex = 0; + this.lblReciveAll.Text = "同时多台终端通讯"; + // + // lblZdUdpData + // + this.lblZdUdpData.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblZdUdpData.Location = new System.Drawing.Point(650, 250); + this.lblZdUdpData.Name = "lblZdUdpData"; + this.lblZdUdpData.Size = new System.Drawing.Size(259, 12); + this.lblZdUdpData.TabIndex = 30; + this.lblZdUdpData.Text = "终端UDP数据\r"; + this.lblZdUdpData.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // + // txtUDP + // + this.txtUDP.Location = new System.Drawing.Point(636, 268); + this.txtUDP.Name = "txtUDP"; + this.txtUDP.Size = new System.Drawing.Size(295, 170); + this.txtUDP.TabIndex = 29; + this.txtUDP.Text = ""; + // + // txtLog + // + this.txtLog.Location = new System.Drawing.Point(636, 77); + this.txtLog.Name = "txtLog"; + this.txtLog.Size = new System.Drawing.Size(295, 170); + this.txtLog.TabIndex = 28; + this.txtLog.Text = ""; + // + // lblState + // + this.lblState.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblState.Location = new System.Drawing.Point(652, 58); + this.lblState.Name = "lblState"; + this.lblState.Size = new System.Drawing.Size(257, 12); + this.lblState.TabIndex = 33; + this.lblState.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // + // lblZdLinked + // + this.lblZdLinked.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblZdLinked.Location = new System.Drawing.Point(650, 37); + this.lblZdLinked.Name = "lblZdLinked"; + this.lblZdLinked.Size = new System.Drawing.Size(259, 13); + this.lblZdLinked.TabIndex = 32; + this.lblZdLinked.Text = "当前操作终端:"; + this.lblZdLinked.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblZdLinkStateInfo + // + this.lblZdLinkStateInfo.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblZdLinkStateInfo.Location = new System.Drawing.Point(649, 13); + this.lblZdLinkStateInfo.Name = "lblZdLinkStateInfo"; + this.lblZdLinkStateInfo.Size = new System.Drawing.Size(260, 16); + this.lblZdLinkStateInfo.TabIndex = 31; + this.lblZdLinkStateInfo.Text = "终端连接状态信息"; + this.lblZdLinkStateInfo.TextAlign = System.Drawing.ContentAlignment.TopCenter; + // + // saveFileDialogRecive + // + this.saveFileDialogRecive.Filter = "所有文件|*.*"; + // + // erpTextBox + // + this.erpTextBox.Location = new System.Drawing.Point(70, 343); + this.erpTextBox.Name = "erpTextBox"; + this.erpTextBox.Size = new System.Drawing.Size(262, 21); + this.erpTextBox.TabIndex = 31; + this.erpTextBox.Text = "http://"; + // + // label4 + // + this.label4.Location = new System.Drawing.Point(23, 346); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(41, 14); + this.label4.TabIndex = 4; + this.label4.Text = "地址:"; + this.label4.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // label5 + // + this.label5.Location = new System.Drawing.Point(23, 368); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(41, 14); + this.label5.TabIndex = 4; + this.label5.Text = "用户:"; + this.label5.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // userTextBox + // + this.userTextBox.Location = new System.Drawing.Point(70, 365); + this.userTextBox.Name = "userTextBox"; + this.userTextBox.Size = new System.Drawing.Size(84, 21); + this.userTextBox.TabIndex = 31; + // + // label6 + // + this.label6.Location = new System.Drawing.Point(201, 368); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(41, 14); + this.label6.TabIndex = 4; + this.label6.Text = "密码:"; + this.label6.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // passTextBox + // + this.passTextBox.Location = new System.Drawing.Point(248, 365); + this.passTextBox.Name = "passTextBox"; + this.passTextBox.Size = new System.Drawing.Size(84, 21); + this.passTextBox.TabIndex = 31; + this.passTextBox.UseSystemPasswordChar = true; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(52, 289); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(95, 12); + this.label7.TabIndex = 20; + this.label7.Text = "服务器文件路径:"; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(369, 317); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(27, 23); + this.button2.TabIndex = 19; + this.button2.Text = "…"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(128, 319); + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(235, 21); + this.textBox1.TabIndex = 18; + // + // label8 + // + this.label8.Location = new System.Drawing.Point(30, 322); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(92, 12); + this.label8.TabIndex = 17; + this.label8.Text = "记录路径"; + this.label8.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(937, 450); + this.Controls.Add(this.lblState); + this.Controls.Add(this.lblZdLinked); + this.Controls.Add(this.lblZdLinkStateInfo); + this.Controls.Add(this.lblZdUdpData); + this.Controls.Add(this.txtUDP); + this.Controls.Add(this.txtLog); + this.Controls.Add(this.panel1); + this.Controls.Add(this.btntpRecive); + this.Controls.Add(this.btntpConn); + this.Controls.Add(this.axW4commsv21); + this.Name = "Form1"; + this.Text = "青花瓷考勤客户端2.0"; + this.Load += new System.EventHandler(this.Form1_Load); + ((System.ComponentModel.ISupportInitialize)(this.axW4commsv21)).EndInit(); + this.panel1.ResumeLayout(false); + this.tabControl1.ResumeLayout(false); + this.tpConnection.ResumeLayout(false); + this.tpConnection.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudPort)).EndInit(); + this.tpReciveFile.ResumeLayout(false); + this.tpReciveFile.PerformLayout(); + this.tpSendFile.ResumeLayout(false); + this.tpSendFile.PerformLayout(); + this.tpReciveFromAny.ResumeLayout(false); + this.tpReciveFromAny.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private AxWEDS4_CommSV2.AxW4commsv2 axW4commsv21; + private System.Windows.Forms.Button btntpConn; + private System.Windows.Forms.Button btntpRecive; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tpConnection; + private System.Windows.Forms.Button btnConnection; + private System.Windows.Forms.Button saveBt; + private System.Windows.Forms.TextBox txtValidate; + private System.Windows.Forms.RadioButton rbAdminValidate; + private System.Windows.Forms.RadioButton rbPassValidate; + private System.Windows.Forms.RadioButton rbNoValidate; + private System.Windows.Forms.Label lblValidateString; + private System.Windows.Forms.TextBox txtTimeout; + private System.Windows.Forms.NumericUpDown nudPort; + private System.Windows.Forms.Label lblConnTimeout; + private System.Windows.Forms.Label lblConnPort; + private System.Windows.Forms.Label lblConnIP; + private System.Windows.Forms.TextBox txtIP; + private System.Windows.Forms.Label lblLinkParameter; + private System.Windows.Forms.ComboBox cbLineMd; + private System.Windows.Forms.Label lblLinkModel; + private System.Windows.Forms.TabPage tpReciveFile; + private System.Windows.Forms.Label lblRZysx1; + private System.Windows.Forms.Label lblRZysx; + private System.Windows.Forms.Button btnRecive; + private System.Windows.Forms.Label lblRZysx3; + private System.Windows.Forms.TabPage tpSendFile; + private System.Windows.Forms.Button btnSendFile; + private System.Windows.Forms.Label lblSZysx; + private System.Windows.Forms.Label lblSZysx2; + private System.Windows.Forms.Label lblSZysx1; + private System.Windows.Forms.TextBox txtZdZhaoPianPath; + private System.Windows.Forms.Label lblSZdZhaoPian; + private System.Windows.Forms.Label lblSZdDangAn; + private System.Windows.Forms.TextBox txtZdDangAnPath; + private System.Windows.Forms.Label lblSZdPath; + private System.Windows.Forms.Label lblSSvPath; + private System.Windows.Forms.Button btnSaveFileZhaoPian; + private System.Windows.Forms.TextBox txtSvZhaoPianPath; + private System.Windows.Forms.Label lblSSvZhaoPian; + private System.Windows.Forms.Button btnSaveFileDangAn; + private System.Windows.Forms.TextBox txtSvDangAnPath; + private System.Windows.Forms.Label lblSSvDangAn; + private System.Windows.Forms.TabPage tpReciveFromAny; + private System.Windows.Forms.CheckBox cbCloseTX; + private System.Windows.Forms.CheckBox cbShowTX; + private System.Windows.Forms.Button btnStartTx; + private System.Windows.Forms.TextBox txtEndIp; + private System.Windows.Forms.TextBox txtStartIP; + private System.Windows.Forms.Label lblEndIP; + private System.Windows.Forms.Label lblStartIP; + private System.Windows.Forms.Label lblRAZysx3; + private System.Windows.Forms.Label lblRAZysx2; + private System.Windows.Forms.Label lblRAZysx1; + private System.Windows.Forms.Label lblRAJilu; + private System.Windows.Forms.Label lblRAZysx; + private System.Windows.Forms.Label lblReciveAll; + private System.Windows.Forms.Label lblZdUdpData; + private System.Windows.Forms.RichTextBox txtUDP; + private System.Windows.Forms.RichTextBox txtLog; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtIP3; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox txtIP2; + private System.Windows.Forms.Label lblState; + private System.Windows.Forms.Label lblZdLinked; + private System.Windows.Forms.Label lblZdLinkStateInfo; + private System.Windows.Forms.Button btnDisconnection; + private System.Windows.Forms.SaveFileDialog saveFileDialogRecive; + private System.Windows.Forms.TextBox txtReciveZDPath; + private System.Windows.Forms.Label lblRSvFilePath; + private System.Windows.Forms.Label lblRZdFilePath; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button stopButton; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox erpTextBox; + private System.Windows.Forms.TextBox passTextBox; + private System.Windows.Forms.TextBox userTextBox; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.OpenFileDialog openFileDialogDangAn; + + } +} + diff --git a/ClientForWEDS/Form1.cs b/ClientForWEDS/Form1.cs new file mode 100644 index 0000000..70df537 --- /dev/null +++ b/ClientForWEDS/Form1.cs @@ -0,0 +1,539 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using System.Xml; +using Forks.Utils.IO; + +namespace ClientForWEDS { + public partial class Form1 : Form { + string _myOper = ""; + string _svPath = ""; + string _zdPath = ""; + private int lineC = 0; + private string lastFile = ""; + private Thread thred; + ManualResetEvent ma; + bool on_off = true; + bool stop = false; + + public Form1() { + InitializeComponent(); + CheckForIllegalCrossThreadCalls = false; + } + + private void Form1_Load(object sender, EventArgs e) { + LoadLanguage("Chinese"); + ConfigUtil.Init(); + //_zdPath = ConfigUtil.ZDPath; + _svPath = Path.Combine(ConfigUtil.RdPath, string.Format("{0}\\", DateTime.Today.ToString("yyyy-MM-dd"))); + if (!FS.DirectoryExists(_svPath)) + FS.CreateDirectory(Path.GetDirectoryName(_svPath)); + cbLineMd.SelectedIndex = 0; + txtIP.Text = ConfigUtil.IP1; + txtIP2.Text = ConfigUtil.IP2; + txtIP3.Text = ConfigUtil.IP3; + txtTimeout.Text = ConfigUtil.Timeout; + nudPort.Text = ConfigUtil.Port; + txtReciveZDPath.Text = ConfigUtil.ZDPath; + erpTextBox.Text = ConfigUtil.ERPURL; + userTextBox.Text = ConfigUtil.UserName; + passTextBox.Text = ConfigUtil.Password; + if (ConfigUtil.ValidateType == "no") + rbNoValidate.Checked = true; + else if (ConfigUtil.ValidateType == "pass") { + rbPassValidate.Checked = true; + } else if (ConfigUtil.ValidateType == "admin") { + rbAdminValidate.Checked = true; + } + + btntpConn.Click += delegate { tabControl1.SelectedTab = tpConnection; }; + btntpRecive.Click += delegate { tabControl1.SelectedTab = tpReciveFile; }; + //dateTimePicker1.Value = DateTime.Now; + thred = new Thread(StartTx); + thred.IsBackground = true; + thred.Start(); + } + + private List ipList = new List(); + private bool isLineing = false; + private void StartTx(object obj) { + while (true) { + if (stop) + return; + + if (on_off) { + ma = new ManualResetEvent(false); + ma.WaitOne(); + } + + var iList = new List(); + foreach (var ip in ipList) + { + iList.Add(ip); + } + //不能直接用ipList,在foreach时候 ipList可能在线程外会被修改 + foreach (var ip in iList) { + txtLog.AppendText("开始连接:" + ip + " \r\n"); + lastFile = ""; + isLineing = true; + LineZd(ip); + //----等待读取记录----- + var c = 0; + while (c < 60 * 2) { + c++; + if (!isLineing) { + //axW4commsv21.CloseZd(); + break; + } + Thread.Sleep(500); + } + //------------------ + if (FS.FileExists(lastFile)) { + DecodeFileToTxt(lastFile, ip); + } + Thread.Sleep(3000); + } + var s10 = 10000; + var m10 = 600000; + Thread.Sleep(s10); + } + + } + + void DisableBt(bool enabled) { + btnConnection.Enabled = enabled; + btnDisconnection.Enabled = enabled; + } + + private void btnConnection_Click(object sender, EventArgs e) { + DisableBt(false); + lineC = 0; + LineZd(txtIP.Text); + + } + + private void btnDisconnection_Click(object sender, EventArgs e) { + axW4commsv21.CloseZd(); + txtLog.SelectionStart = txtLog.Text.Length; + txtUDP.SelectionStart = txtUDP.Text.Length; + } + + private string tcpMode = "以太网通讯(TCP/IP)"; + + private void LineZd(string ip) { + int connectionKind; + string connType = cbLineMd.SelectedItem.ToString(); + if (connType == tcpMode) { + connectionKind = 0; + } else { + MessageBox.Show("不支持的连接方式"); + return; + } + axW4commsv21.OverTime = Convert.ToInt32(txtTimeout.Text); + axW4commsv21.LineMd = connectionKind; + axW4commsv21.NetPort = Convert.ToInt32(nudPort.Value); + axW4commsv21.LineZd(ip, txtValidate.Text); + lblState.Text = ip + ":" + nudPort.Value.ToString(); + } + + Dictionary _dicMessage; + void LoadLanguage(string languageName) { + _dicMessage = new Dictionary(); + var xml = new XmlDocument(); + xml.Load(Application.StartupPath + "\\language\\" + languageName + ".xml"); + var nodeList = xml.ChildNodes[1].ChildNodes; + foreach (XmlNode node in nodeList) { + if (node.Name == "Messages") { + foreach (XmlNode item in node.ChildNodes) { + if (item.Attributes == null) + continue; + _dicMessage.Add(item.Attributes["Key"].Value, item.Attributes["Value"].Value); + } + continue; + } + if ((!node.Name.Equals("Label") && + !node.Name.Equals("ComboBox") && + !node.Name.Equals("Button") && + !node.Name.Equals("RadioButton") && + !node.Name.Equals("CheckBox")) || node.Attributes == null) + continue; + var control = FindControl(this, node.Attributes["Name"].Value); + if (control != null && node.Attributes["Text"] != null) + control.Text = node.Attributes["Text"].Value; + } + } + + Control FindControl(Control pControl, string pControlName) { + if (pControl.Name == pControlName) + return pControl; + for (int i = 0; i != pControl.Controls.Count; i++) { + Control subControl = FindControl(pControl.Controls[i], pControlName); + if (subControl != null) + return subControl; + } + return null; + } + + private void rbValidate_Checked(object sender, EventArgs e) { + var realKind = cbLineMd.SelectedItem.ToString(); + if (rbNoValidate.Checked) { + if (realKind.Equals(tcpMode)) { + txtValidate.Text = "id=\r\n" + "card=\r\n" + "password=\r\n" + "line=\r\n"; + } + } + if (rbPassValidate.Checked) { + if (realKind.Equals(tcpMode)) { + txtValidate.Text = "id=\r\n" + "card=\r\n" + "password=\r\n" + "line=12345\r\n"; + } + } + if (rbAdminValidate.Checked) { + if (realKind.Equals(tcpMode)) { + txtValidate.Text = "id=001\r\n" + "card=50EF082A\r\n" + "password=1234\r\n" + "line=12345\r\n"; + } + + } + } + + + private void axW4commsv21_InfoZdEvent(object sender, AxWEDS4_CommSV2.__W4commsv2_InfoZdEvent e) { + txtUDP.Text += "ip=" + e.zdadd + enterStr + axW4commsv21.InfoZd + enterStr; + } + + private string enterStr = "\r\n"; + + private void axW4commsv21_OnEvent(object sender, EventArgs e) { + DisableBt(true); + var length = txtLog.Text.Length; + if (length > 1000) + txtLog.Text = txtLog.Text.Substring(length - 100); + switch (axW4commsv21.RunEvent) { + case "ok": + switch (axW4commsv21.RunZl) { + case "linezd": + //txtLog.Text += (_dicMessage["LineZdSuccess"] + enterStr); + switch (_myOper) { + case "upfile": + txtLog.Text += (_dicMessage["StartReciveFileToPcFromZd"] + enterStr); + lastFile = GetRdPath(); + axW4commsv21.UploadFile(lastFile, _zdPath); + break; + case "dwnpht": + txtLog.Text += (_dicMessage["StartSendZhaoPianToZdFromPc"] + enterStr); + axW4commsv21.DwloadFile(GetRdPath(), _zdPath); + break; + case "retime": + txtLog.Text += (_dicMessage["StartReTime"] + enterStr); + //if (rbDatetimeNow.Checked) { + // axW4commsv21.ReTime(DateTime.Now); + //} else { + // DateTime time = new DateTime(dateTimePicker1.Value.Year, dateTimePicker1.Value.Month, dateTimePicker1.Value.Day, Convert.ToInt32(nudHour.Value), Convert.ToInt32(nudMinute.Value), 0); + // axW4commsv21.ReTime(time); + //} + break; + } + break; + case "uploadfile": + if (_myOper == "upfile") { + txtLog.Text += (_dicMessage["ReadFileSuccess"] + GetRdPath() + enterStr); + txtLog.Text += (_dicMessage["BeginDeleteZdFile"] + enterStr); + axW4commsv21.DeleteFile(_zdPath); + } + break; + case "dwloadfile": + switch (_myOper) { + case "dwnpht": + txtLog.Text += (_dicMessage["WriteZhaoPianSuccess"] + enterStr); + _myOper = "dwnwdda"; + txtLog.Text += (_dicMessage["StartWriteFileFromPcToZd"] + enterStr); + _zdPath = txtZdDangAnPath.Text.Trim(); + //_svPath = txtSvDangAnPath.Text.Trim(); + axW4commsv21.DwloadFile(GetRdPath(), _zdPath); + break; + case "dwnwdda": + txtLog.Text += (_dicMessage["WriteDangAnFileSuccess"] + enterStr); + txtLog.Text += (_dicMessage["Disconnectioning"] + enterStr); + axW4commsv21.CloseZd(); + isLineing = false; + break; + } + break; + case "deletefile": + if (_myOper == "upfile") { + txtLog.Text += (_dicMessage["DeleteZdFileSuccess"] + enterStr); + txtLog.Text += (_dicMessage["Disconnectioning"] + enterStr); + axW4commsv21.CloseZd(); + isLineing = false; + } + break; + case "retime": + txtLog.Text += (_dicMessage["ReTimeSuccess"] + enterStr); + txtLog.Text += (_dicMessage["Disconnectioning"] + enterStr); + axW4commsv21.CloseZd(); + break; + } + + break; + case "error": + if (axW4commsv21.RunZl == "linezd") + txtLog.Text += (_dicMessage["ConnectionFaileAndPleaseCheckPass"] + enterStr); + else if (axW4commsv21.RunZl == "closezd") + txtLog.Text += (_dicMessage["DisconnectionFails"] + enterStr); + else if (axW4commsv21.RunZl == "uploadfile") { + if (_myOper == "upfile") { + txtLog.Text += (_dicMessage["ReadFileNotExists"] + _zdPath + enterStr); + txtLog.Text += (_dicMessage["Disconnectioning"] + enterStr); + axW4commsv21.CloseZd(); + isLineing = false; + } + } else if (axW4commsv21.RunZl == "dwloadfile") { + txtLog.Text += (_dicMessage["WriteFileFails"] + GetRdPath() + enterStr); + txtLog.Text += (_dicMessage["Disconnectioning"] + enterStr); + axW4commsv21.CloseZd(); + isLineing = false; + } else if (axW4commsv21.RunZl == "deletefile") { + if (_myOper == "upfile") { + txtLog.Text += (_dicMessage["DeleteZdFileNotExistsOrStopSudden"] + enterStr); + txtLog.Text += (_dicMessage["Disconnectioning"] + enterStr); + axW4commsv21.CloseZd(); + isLineing = false; + } + } + break; + case "overtime": + if (axW4commsv21.RunZl == "linezd") + txtLog.Text += (_dicMessage["ConnectionFails"] + enterStr); + isLineing = false; + break; + } + txtLog.SelectionStart = txtLog.Text.Length - 1; + txtLog.ScrollToCaret(); + + } + + private int i = 0; + + string GetRdPath() { + i++; + var filePath = Path.Combine(_svPath, string.Format("{0}{1}.wds", DateTime.Now.ToString("HH.mm.sss"), i)); + return filePath; + } + + private void axW4commsv21_LineZdEvent(object sender, EventArgs e) { + var length = txtUDP.Text.Length; + if (length > 200) + txtUDP.Text = txtUDP.Text.Substring(length - 100); + + switch (axW4commsv21.LineEvent) { + case 0: + txtLog.Text += _dicMessage["Disconnectioned"] + enterStr; + break; + case 1: + case 2: + lineC++; + if (lineC <= 1) { + txtUDP.Text = ""; + txtUDP.Text += axW4commsv21.DataZd; + txtLog.Text += axW4commsv21.Zdip + enterStr + _dicMessage["ConnectionSuccess"] + enterStr + _dicMessage["PassedAdmin"] + enterStr; + } + break; + default: + throw new Exception(); + } + txtUDP.SelectionStart = txtUDP.Text.Length - 1; + txtUDP.ScrollToCaret(); + } + + private void stopButton_Click(object sender, EventArgs e) { + on_off = true; + txtLog.AppendText("停止采集 :" + DateTime.Now.ToLongTimeString() + "\r\n"); + btnRecive.Enabled = true; + lblState.BackColor = Color.WhiteSmoke; + } + + private void btnRecive_Click(object sender, EventArgs e) { + ipList.Clear(); + if (txtIP.Text.Length > 0) + ipList.Add(txtIP.Text); + if (txtIP2.Text.Length > 0) + ipList.Add(txtIP2.Text); + if (txtIP3.Text.Length > 0) + ipList.Add(txtIP3.Text); + _zdPath = txtReciveZDPath.Text.Trim(); + on_off = false; + ma.Set(); + txtLog.AppendText("开始采集 :" + DateTime.Now.ToLongTimeString() + "\r\n"); + _myOper = "upfile"; + btnRecive.Enabled = false; + lblState.BackColor = Color.GreenYellow; + ////_svPath = txtReciveServerPath.Text.Trim(); + //if (_zdPath != "" && _svPath != "") { + // _myOper = "upfile"; + // LineZd(txtIP.Text); + //} + } + + private void saveBt_Click(object sender, EventArgs e) { + using (var reader = FS.OpenReader(ConfigUtil.ConfigFilePath, true)) { + var nutFile = NutFile.Parse(reader); + if (rbNoValidate.Checked) + nutFile.SetValue(ConfigUtil.ConfigItem.ValidateType, "no"); + else if (rbPassValidate.Checked) { + nutFile.SetValue(ConfigUtil.ConfigItem.ValidateType, "pass"); + } else if (rbAdminValidate.Checked) { + nutFile.SetValue(ConfigUtil.ConfigItem.ValidateType, "admin"); + } + nutFile.SetValue(ConfigUtil.ConfigItem.IP1, txtIP.Text.Trim()); + nutFile.SetValue(ConfigUtil.ConfigItem.IP2, txtIP2.Text.Trim()); + nutFile.SetValue(ConfigUtil.ConfigItem.IP3, txtIP3.Text.Trim()); + nutFile.SetValue(ConfigUtil.ConfigItem.Port, nudPort.Text.Trim()); + nutFile.SetValue(ConfigUtil.ConfigItem.Timeout, txtTimeout.Text.Trim()); + nutFile.SetValue(ConfigUtil.ConfigItem.ZDPath, txtReciveZDPath.Text.Trim()); + nutFile.SetValue(ConfigUtil.ConfigItem.ERPURL, erpTextBox.Text.Trim()); + nutFile.SetValue(ConfigUtil.ConfigItem.UserName, userTextBox.Text.Trim()); + nutFile.SetValue(ConfigUtil.ConfigItem.Password, passTextBox.Text.Trim()); + using (TextWriter writer = FS.OpenWriter(ConfigUtil.ConfigFilePath, createDirsIfNotExist: true)) { + nutFile.Write(writer); + } + } + ConfigUtil.IP1 = txtIP.Text; + ConfigUtil.IP2 = txtIP2.Text; + ConfigUtil.IP3 = txtIP3.Text; + ConfigUtil.Port = nudPort.Text; + ConfigUtil.Timeout = txtTimeout.Text; + ConfigUtil.ZDPath = txtReciveZDPath.Text; + ConfigUtil.ERPURL = erpTextBox.Text; + ConfigUtil.UserName = userTextBox.Text; + ConfigUtil.Password = passTextBox.Text; + MessageBox.Show("保存成功"); + } + + //解密文件 + private void DecodeFileToTxt(string filePath, string ip) { + var encodeFile = filePath; + var list = new List(); + if (encodeFile == "") + return; + if (File.Exists(encodeFile)) { + var fsRead = new FileStream(encodeFile, FileMode.Open); + var sr = new StreamReader(fsRead); + while (true) { + var line = sr.ReadLine(); + if (line == null) { + break; + } + var str = axW4commsv21.OptStr(line); + list.Add(str); + } + sr.Close(); + fsRead.Close(); + } + + AddToTxt(list, ip); + var msg = DoInsert(list, ip); + if (string.IsNullOrEmpty(msg)) + txtLog.AppendText("成功上传" + list.Count + "条记录\r\n"); + } + + private static string DoInsert(List list, string ip = "") { + var rdList = new List(); + //110003,2017-10-16 13:42:10,f,0,1,,jk134210 + foreach (var str in list) { + if (string.IsNullOrEmpty(str)) + continue; + var arrStr = str.Split(','); + if (arrStr.Length < 2) + continue; + var att = new AttLog(); + int id; + if (int.TryParse(arrStr[0], out id)) { + att.ID = id; + } else { + continue; + } + try { + att.DateTime = Convert.ToDateTime(arrStr[1]); + } catch (Exception) { + continue; + } + if (!string.IsNullOrEmpty(ip)) { + att.IP = ip; + } else { + var index = str.IndexOf("ip="); + if (index > -1) { + var ipStr = str.Substring(index+3); + att.IP = ipStr; + } + } + rdList.Add(att); + } + var groupBy = rdList.GroupBy(x => x.IP); + var msg = new StringBuilder(); + foreach (var details in groupBy) { + var s = RpcHelper.Insert(details.ToList(), details.Key); + if (!string.IsNullOrEmpty(s)) + msg.AppendLine(s); + } + return msg.ToString(); + } + + private void AddToTxt(IEnumerable msg, string ip) { + var filePath = Path.Combine(_svPath, string.Format("log.txt")); + using (var fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write)) { + using (var sw = new StreamWriter(fs)) { + sw.BaseStream.Seek(0, SeekOrigin.End); + foreach (var s in msg) { + sw.WriteLine(s + ",ip=" + ip); + } + sw.Flush(); + } + } + } + + private void button1_Click(object sender, EventArgs e) { + var list = new List(); + var file = textBox1.Text; + if (file == "") { + MessageBox.Show("先选择日志文件"); + return; + } + if (File.Exists(file)) { + var fsRead = new FileStream(file, FileMode.Open); + var sr = new StreamReader(fsRead); + while (true) { + var line = sr.ReadLine(); + if (line == null) { + break; + } + list.Add(line); + } + sr.Close(); + fsRead.Close(); + } + var msg = DoInsert(list); + if (string.IsNullOrEmpty(msg)) + MessageBox.Show("操作成功"); + else { + MessageBox.Show(msg); + } + } + + public class AttLog { + public int ID { get; set; } + public DateTime DateTime { get; set; } + public string IP { get; set; } + public bool Uploaded { get; set; } + } + + private void button2_Click(object sender, EventArgs e) { + DialogResult dr = openFileDialogDangAn.ShowDialog(); + if (dr == DialogResult.OK) { + textBox1.Text = openFileDialogDangAn.FileName; + } + } + } +} diff --git a/ClientForWEDS/Form1.resx b/ClientForWEDS/Form1.resx new file mode 100644 index 0000000..1078fe6 --- /dev/null +++ b/ClientForWEDS/Form1.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACFTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5BeEhvc3QrU3RhdGUBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAXQAAAAIB + AAAAAQAAAAAAAAAAAAAAAEgAAACTsgAASAAAAAMACAAL8ldHIAAAAF8AZQB4AHQAZQBuAHQAeABDEQAA + AwAIAAryV0fg////XwBlAHgAdABlAG4AdAB5ALACAAAL + + + + 17, 17 + + + 380, 17 + + \ No newline at end of file diff --git a/ClientForWEDS/Interop.WEDS4_CommSV2.dll b/ClientForWEDS/Interop.WEDS4_CommSV2.dll new file mode 100644 index 0000000000000000000000000000000000000000..aa70e60800b4f17f4bbf4e3f0547cdc3fc10f3cc GIT binary patch literal 11264 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 PB7H1E{#B4azYP30>Tr+- literal 0 HcmV?d00001 diff --git a/ClientForWEDS/Program.cs b/ClientForWEDS/Program.cs new file mode 100644 index 0000000..483e188 --- /dev/null +++ b/ClientForWEDS/Program.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace ClientForWEDS { + static class Program { + /// + /// 应用程序的主入口点。 + /// + [STAThread] + static void Main() { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/ClientForWEDS/Properties/AssemblyInfo.cs b/ClientForWEDS/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4135f11 --- /dev/null +++ b/ClientForWEDS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的常规信息通过以下 +// 特性集控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("ClientForWEDS")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("ClientForWEDS")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 使此程序集中的类型 +// 对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型, +// 则将该类型上的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("68d1343a-7dec-4eff-ba2f-21c36862912a")] + +// 程序集的版本信息由下面四个值组成: +// +// 主版本 +// 次版本 +// 内部版本号 +// 修订号 +// +// 可以指定所有这些值,也可以使用“内部版本号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ClientForWEDS/Properties/Resources.Designer.cs b/ClientForWEDS/Properties/Resources.Designer.cs new file mode 100644 index 0000000..7908cac --- /dev/null +++ b/ClientForWEDS/Properties/Resources.Designer.cs @@ -0,0 +1,62 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本: 4.0.30319.18063 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace ClientForWEDS.Properties { + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .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 { + + 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() { + } + + /// + /// 返回此类使用的、缓存的 ResourceManager 实例。 + /// + [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("ClientForWEDS.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 为所有资源查找重写当前线程的 CurrentUICulture 属性, + /// 方法是使用此强类型资源类。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/ClientForWEDS/Properties/Resources.resx b/ClientForWEDS/Properties/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/ClientForWEDS/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ClientForWEDS/Properties/Settings.Designer.cs b/ClientForWEDS/Properties/Settings.Designer.cs new file mode 100644 index 0000000..bbc377e --- /dev/null +++ b/ClientForWEDS/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18063 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ClientForWEDS.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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 { + return defaultInstance; + } + } + } +} diff --git a/ClientForWEDS/Properties/Settings.settings b/ClientForWEDS/Properties/Settings.settings new file mode 100644 index 0000000..abf36c5 --- /dev/null +++ b/ClientForWEDS/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/ClientForWEDS/RpcHelper.cs b/ClientForWEDS/RpcHelper.cs new file mode 100644 index 0000000..eea0247 --- /dev/null +++ b/ClientForWEDS/RpcHelper.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using Forks.JsonRpc.Client; +using Forks.JsonRpc.Client.Data; +using Forks.Utils.IO; + +namespace ClientForWEDS { + public static class RpcHelper { + private static bool _isInit; + public static string Insert(List logList, string ip) { + var logName = "RpcLog" + DateTime.Today.ToString("yyyyMMdd") + ".txt"; + + var path = Application.StartupPath + "\\log\\" + logName ; + var resultStr = ""; + if (!FS.DirectoryExists(path)) + FS.CreateDirectory(Path.GetDirectoryName(path)); + using (var textWriter = new StreamWriter(path, true, Encoding.UTF8)) { + textWriter.WriteLine("{0} :ͻ˿ʼݣ------------------------------------", DateTime.Now); + try { + if (!_isInit) { + var url = ConfigUtil.ERPURL; + //var url = "http://localhost:2100/MainSystem/"; + RpcFacade.Init(url, "AttendClientV2.0"); + _isInit = true; + } + var username = ConfigUtil.UserName;// "system" + var strPwd = ConfigUtil.Password; + RpcFacade.Login(username, strPwd); + var dmos = new List(); + foreach (var detail in logList) { + + var dmo = new RpcObject("/CutUp/Attendance/BO/AttendanceRecord"); + dmo.Set("Time", detail.DateTime); + dmo.Set("EmployeeID", detail.ID); + dmos.Add(dmo); + } + RpcFacade.Call("/CutUp/Attendance/Rpcs/AttendanceRpc/Insert2", dmos.ToArray(), ip); + textWriter.WriteLine(dmos.Count() + "ڼ¼ϴɹ,ڻIP" + ip); + } catch (Exception e) { + textWriter.WriteLine("ڲ" + e.Message); + resultStr = e.Message; + } finally { + RpcFacade.Logout(); + } + } + return resultStr; + } + + } +} \ No newline at end of file diff --git a/ClientForWEDS/language/Chinese.xml b/ClientForWEDS/language/Chinese.xml new file mode 100644 index 0000000..65691a7 --- /dev/null +++ b/ClientForWEDS/language/Chinese.xml @@ -0,0 +1,134 @@ + + +