Browse Source

init

master
robin 8 years ago
commit
0ae2b7f8a4
22 changed files with 2575 additions and 0 deletions
  1. +20
    -0
      ClientForWEDS.sln
  2. BIN
      ClientForWEDS/AxInterop.WEDS4_CommSV2.dll
  3. +118
    -0
      ClientForWEDS/ClientForWEDS.csproj
  4. +1
    -0
      ClientForWEDS/Config.txt
  5. +54
    -0
      ClientForWEDS/ConfigUtil.cs
  6. +1123
    -0
      ClientForWEDS/Form1.Designer.cs
  7. +539
    -0
      ClientForWEDS/Form1.cs
  8. +135
    -0
      ClientForWEDS/Form1.resx
  9. BIN
      ClientForWEDS/Interop.WEDS4_CommSV2.dll
  10. +18
    -0
      ClientForWEDS/Program.cs
  11. +36
    -0
      ClientForWEDS/Properties/AssemblyInfo.cs
  12. +62
    -0
      ClientForWEDS/Properties/Resources.Designer.cs
  13. +117
    -0
      ClientForWEDS/Properties/Resources.resx
  14. +26
    -0
      ClientForWEDS/Properties/Settings.Designer.cs
  15. +7
    -0
      ClientForWEDS/Properties/Settings.settings
  16. +54
    -0
      ClientForWEDS/RpcHelper.cs
  17. +134
    -0
      ClientForWEDS/language/Chinese.xml
  18. +131
    -0
      ClientForWEDS/language/English.xml
  19. BIN
      ClientForWEDS/ocx/mscomm32.ocx
  20. BIN
      ClientForWEDS/ocx/mswinsck.ocx
  21. BIN
      ClientForWEDS/ocx/w4commsv2.ocx
  22. BIN
      ClientForWEDS/tx.exe

+ 20
- 0
ClientForWEDS.sln View File

@ -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

BIN
ClientForWEDS/AxInterop.WEDS4_CommSV2.dll View File


+ 118
- 0
ClientForWEDS/ClientForWEDS.csproj View File

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3C4FECB4-41CA-429E-9688-59D22D4737CB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ClientForWEDS</RootNamespace>
<AssemblyName>ClientForWEDS</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AxInterop.WEDS4_CommSV2">
<HintPath>.\AxInterop.WEDS4_CommSV2.dll</HintPath>
</Reference>
<Reference Include="Forks.JsonRpc.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>E:\BWPB3\tsref\Debug\Forks.JsonRpc.Client.dll</HintPath>
</Reference>
<Reference Include="Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\tsref\Debug\Forks.Utils.dll</HintPath>
</Reference>
<Reference Include="Interop.WEDS4_CommSV2">
<HintPath>.\Interop.WEDS4_CommSV2.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConfigUtil.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RpcHelper.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="Config.txt" />
<Content Include="language\Chinese.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="language\English.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="ocx\mscomm32.ocx" />
<Content Include="ocx\mswinsck.ocx" />
<Content Include="ocx\w4commsv2.ocx" />
<Content Include="tx.exe" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

+ 1
- 0
ClientForWEDS/Config.txt View File

@ -0,0 +1 @@


+ 54
- 0
ClientForWEDS/ConfigUtil.cs View File

@ -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";
}
}
}

+ 1123
- 0
ClientForWEDS/Form1.Designer.cs
File diff suppressed because it is too large
View File


+ 539
- 0
ClientForWEDS/Form1.cs View File

@ -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<string> ipList = new List<string>();
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<string>();
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<string, string> _dicMessage;
void LoadLanguage(string languageName) {
_dicMessage = new Dictionary<string, string>();
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<string>();
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<string> list, string ip = "") {
var rdList = new List<AttLog>();
//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<string> 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<string>();
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;
}
}
}
}

+ 135
- 0
ClientForWEDS/Form1.resx View File

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

BIN
ClientForWEDS/Interop.WEDS4_CommSV2.dll View File


+ 18
- 0
ClientForWEDS/Program.cs View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace ClientForWEDS {
static class Program {
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

+ 36
- 0
ClientForWEDS/Properties/AssemblyInfo.cs View File

@ -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")]

+ 62
- 0
ClientForWEDS/Properties/Resources.Designer.cs View File

@ -0,0 +1,62 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.18063
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ClientForWEDS.Properties {
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 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() {
}
/// <summary>
/// 返回此类使用的、缓存的 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("ClientForWEDS.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 为所有资源查找重写当前线程的 CurrentUICulture 属性,
/// 方法是使用此强类型资源类。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

+ 117
- 0
ClientForWEDS/Properties/Resources.resx View File

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

+ 26
- 0
ClientForWEDS/Properties/Settings.Designer.cs View File

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}

+ 7
- 0
ClientForWEDS/Properties/Settings.settings View File

@ -0,0 +1,7 @@
<?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>

+ 54
- 0
ClientForWEDS/RpcHelper.cs View File

@ -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<Form1.AttLog> 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<RpcObject>();
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<object>("/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;
}
}
}

+ 134
- 0
ClientForWEDS/language/Chinese.xml View File

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="utf-8" ?>
<Language>
<Label Name="lblZdLinkStateInfo" Text="终端连接状态信息" />
<Label Name="lblZdLinked" Text="当前操作终端:" />
<Label Name="lblZdUdpData" Text="终端UDP数据" />
<!--<Button Name="btntpConn" Text="终端连接/断开" />-->
<Button Name="btntpRecive" Text="终端文件读取到PC" />
<Button Name="btntpSend" Text="PC文件写入到终端" />
<Button Name="btntpTime" Text="终端对钟" />
<Button Name="btntpDecode" Text="文件解密" />
<Button Name="btntpUDP" Text="实时数据(UDP)" />
<Button Name="btntpReciveAll" Text="同时采集终端(并发)" />
<!--TabPage Name="tpConnection">-->
<Label Name="lblLinkModel" Text="1.连接网络模式:" />
<Label Name="lblLinkParameter" Text="2.终端基本参数:" />
<Label Name="lblValidateString" Text="3.连接验证字串:" />
<Label Name="lblConnIP" Text="IP地址:" />
<Label Name="lblConnPort" Text="端口号:" />
<Label Name="lblConnTimeout" Text="超时时间:" />
<Label Name="lblMac" Text="MAC地址:" />
<Label Name="lblCom" Text="串口号:" />
<Label Name="lblBit" Text="波特率:" />
<ComboBox Name="cbLineMd">
<ComboBoxItem Name="TcpKind" Text="以太网通讯(TCP/IP)" />
<ComboBoxItem Name="ComKind" Text="串口通讯" />
<ComboBoxItem Name="GprsKind" Text="代理模式(GPRS/ADSL)" />
</ComboBox>
<RadioButton Name="rbNoValidate" Text="不验证" />
<RadioButton Name="rbPassValidate" Text="密码验证" />
<RadioButton Name="rbAdminValidate" Text="管理员验证" />
<Button Name="btnConnection" Text="测试连接" />
<Button Name="btnDisconnection" Text="断开连接" />
<!--</TabPage>-->
<!--<TabPage Name="tpReciveFile">-->
<!--<Label Name="lblRZdFilePath" Text="1.终端文件路径:" />-->
<Label Name="lblRZdFileEx" Text="终端考勤记录为例" />
<Label Name="lblRSvFilePath" Text="2.服务器文件存放路径:" />
<Label Name="lblRZysx" Text="注意事项" />
<Label Name="lblRZysx1" Text="1.服务器文件路径中文件夹需要存在或程序提前创建" />
<Label Name="lblRZysx2" Text="即:控件本身不创建文件夹" />
<Label Name="lblRZysx3" Text="2.文件传输成功后会覆盖同名文件" />
<!--<Button Name="btnRecive" Text="文件传输" />-->
<!--</TabPage>-->
<!--<TabPage Name="tpSendFile">-->
<Label Name="lblSSvPath" Text="1.服务器文件路径:" />
<Label Name="lblSSvDangAn" Text="档案路径" />
<Label Name="lblSSvZhaoPian" Text="照片路径" />
<!--<Label Name="lblSZdPath" Text="2.终端文件存放路径:" />-->
<Label Name="lblSZdDangAn" Text="档案路径" />
<Label Name="lblSZdZhaoPian" Text="照片路径" />
<Label Name="lblSZysx" Text="注意事项" />
<Label Name="lblSZysx1" Text="1.请勿随意传输非法文件充当档案及照片,终端可能因无法加载而造成异常" />
<Label Name="lblSZysx2" Text="2.写入档案及照片指纹文件到终端时,先写照片指纹成功后再写入档案" />
<Button Name="btnSendFile" Text="文件传输" />
<!--</TabPage>-->
<!--<TabPage Name="tpCheckTime">-->
<RadioButton Name="rbDatetimeNow" Text="不验证" />
<RadioButton Name="rbTimeUserDefined" Text="密码验证" />
<Label Name="lblTimeHour" Text="时" />
<Label Name="lblTimeMinute" Text="分" />
<Button Name="btnChangeTime" Text="终端机对钟" />
<!--</TabPage>-->
<!--<TabPage Name="tpFileDecode">-->
<Label Name="lblStringDecodeAndEncode" Text="1.字符串加密解密:" />
<Label Name="lblDSourceString" Text="原字符串" />
<Label Name="lblDDecodeString" Text="加密后字符串" />
<Label Name="lblDUncodeString" Text="解密后字符串" />
<Button Name="btnEncode" Text="加密" />
<Button Name="btnDecode" Text="解密" />
<Label Name="lblFileDecode" Text="2.文件解密:" />
<Label Name="lblEncodeFile" Text="原加密文件" />
<Label Name="lblDecodeFile" Text="解密后文件" />
<Button Name="btnDecodeFile" Text="解密文件" />
<Button Name="btnReadFile" Text="查看文件" />
<!--</TabPage>-->
<!--<TabPage Name="tpUdp">-->
<Label Name="lblNeedBindPort" Text="需要绑定端口号" />
<Label Name="lblUFx" Text="例如:" />
<Label Name="lblUFx1" Text="通讯端口号设置为3350,端口绑定后实际绑定端口为UDP 3351,即:3350+1 用作侦听终端发送至服务器的数据" />
<Label Name="lblUZysx" Text="注意事项" />
<Label Name="lblUZysx1" Text="通过控件的CortZd方法向终端发送控制指令时,同样进行端口绑定,并在终端设置服务器IP等信息" />
<Label Name="lblUZdPic" Text="终端图片信息" />
<Button Name="btnBindPort" Text="绑定端口" />
<Button Name="btnStartUDP" Text="显示图片" />
<Button Name="btnEndUdp" Text="停止显示" />
<!--</TabPage>-->
<!--<TabPage Name="tpReciveFromAny">-->
<Label Name="lblReciveAll" Text="同时多台终端通讯" />
<Label Name="lblRAJilu" Text="以采集记录为例" />
<Label Name="lblStartIP" Text="起始IP地址" />
<Label Name="lblEndIP" Text="终止IP地址" />
<CheckBox Name="cbShowTX" Text="是否显示通讯窗体" />
<CheckBox Name="cbCloseTX" Text="是否自动关闭通讯窗体" />
<Label Name="lblRAZysx" Text="注意事项" />
<Label Name="lblRAZysx1" Text="1.该实例采用多进程模式,调用多个实例完成" />
<Label Name="lblRAZysx2" Text="2.记录文件存放路径为 ..\Data\终端IP地址.wds" />
<Label Name="lblRAZysx3" Text="3.本例只作演示,且勿并发过多" />
<Button Name="btnStartTx" Text="开始并发采集" />
<!--</TabPage>-->
<Messages>
<Add Key="LineZdSuccess" Value="连接终端成功" />
<Add Key="StartReciveFileToPcFromZd" Value="开始从终端读取文件到PC..." />
<Add Key="StartSendZhaoPianToZdFromPc" Value="开始从PC写入照片文件到终端... *.pht" />
<Add Key="StartReTime" Value="开始对终端对钟操作..." />
<Add Key="ReadFileSuccess" Value="读取文件成功!
存放路径:" />
<Add Key="BeginDeleteZdFile" Value="开始删除终端文件..." />
<Add Key="WriteZhaoPianSuccess" Value="写入照片文件成功!" />
<Add Key="StartWriteFileFromPcToZd" Value="开始从PC写入档案文件到终端... wdda.wts" />
<Add Key="WriteDangAnFileSuccess" Value="写入档案文件wdda.wts成功!" />
<Add Key="Disconnectioning" Value="正在断开终端连接..." />
<Add Key="DeleteZdFileSuccess" Value="删除终端文件成功!" />
<Add Key="ReTimeSuccess" Value="终端对钟操作成功!" />
<Add Key="ConnectionFaileAndPleaseCheckPass" Value="连接失败,请检查连接验证密码等设备连接信息" />
<Add Key="DisconnectionFails" Value="断开连接操作失败" />
<Add Key="ReadFileNotExists" Value="读取文件不存在!" />
<Add Key="WriteFileFails" Value="写入文件异常!" />
<Add Key="DeleteZdFileNotExistsOrStopSudden" Value="删除终端文件不存在或异常中止!" />
<Add Key="ConnectionFails" Value="连接超时
原因:1.设备IP地址设置错误 2.网络连接不成功 3.端口号设置异常或被禁用" />
<Add Key="Disconnectioned" Value="已断开连接" />
<Add Key="ConnectionSuccess" Value="已连接成功" />
<Add Key="PassedAdmin" Value="已通过身份验证" />
<Add Key="FileEncodeSuccess" Value="文件解密成功!" />
<Add Key="SourceDecodeFileNotExists" Value="原加密文件不存在!请检查路径!" />
<Add Key="CurrentCommunicationPortIs" Value="当前通讯用端口号为:" />
<Add Key="BindUdpPortIs" Value="绑定端口号为:UDP " />
<Add Key="BindPortFails" Value="绑定端口失败!
原因:" />
<Add Key="Exception" Value="异常!\r\n原因:" />
<Add Key="GetDataFromIP" Value="已从{0}采集数据!" />
<Add Key="StartIpIsBiggerThanEndIp" Value="起始IP不能大于终止IP!" />
</Messages>
</Language>

+ 131
- 0
ClientForWEDS/language/English.xml View File

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8" ?>
<Language>
<Label Name="lblZdLinkStateInfo" Text="Terminal link status info" />
<Label Name="lblZdLinked" Text="current operating terminal:" />
<Label Name="lblZdUdpData" Text="terminal UDP data" />
<Button Name="btntpConn" Text="terminal connect/disconnect" />
<Button Name="btntpRecive" Text="read file to PC" />
<Button Name="btntpSend" Text="PC file to terminal" />
<Button Name="btntpTime" Text="time synchronization" />
<Button Name="btntpDecode" Text="file decode" />
<Button Name="btntpUDP" Text="realtime data(UDP)" />
<Button Name="btntpReciveAll" Text="receive all simultaneously" />
<!--<TabPage Name="tpConnection">-->
<Label Name="lblLinkModel" Text="1.net link model:" />
<Label Name="lblLinkParameter" Text="2.Terminal basic parameters:" />
<Label Name="lblValidateString" Text="3.link valid string:" />
<Label Name="lblConnIP" Text="IP address:" />
<Label Name="lblConnPort" Text="port No.:" />
<Label Name="lblConnTimeout" Text="overtime:" />
<Label Name="lblMac" Text="MAC address:" />
<Label Name="lblCom" Text="COM No.:" />
<Label Name="lblBit" Text="Baud rate:" />
<ComboBox Name="cbLineMd">
<ComboBoxItem Name="TcpKind" Text="Ethernet communication(TCP/IP)" />
<ComboBoxItem Name="ComKind" Text="COM communication" />
<ComboBoxItem Name="GprsKind" Text="proxy mode(GPRS/ADSL)" />
</ComboBox>
<RadioButton Name="rbNoValidate" Text="no verify" />
<RadioButton Name="rbPassValidate" Text="password verify" />
<RadioButton Name="rbAdminValidate" Text="admin verify" />
<Button Name="btnConnection" Text="connect" />
<Button Name="btnDisconnection" Text="disconnect" />
<!--</TabPage>-->
<!--<TabPage Name="tpReciveFile">-->
<Label Name="lblRZdFilePath" Text="1.terminal file path:" />
<Label Name="lblRZdFileEx" Text="terminal record sample" />
<Label Name="lblRSvFilePath" Text="2.server file save path:" />
<Label Name="lblRZysx" Text="notice" />
<Label Name="lblRZysx1" Text="1.in the server file path, save folder or create program in advance" />
<Label Name="lblRZysx2" Text="activeX itself does not create folder" />
<Label Name="lblRZysx3" Text="2.cover the same file after file transmission succeeded" />
<Button Name="btnRecive" Text="file transmission" />
<!--</TabPage>-->
<!--<TabPage Name="tpSendFile">-->
<Label Name="lblSSvPath" Text="1.server file path:" />
<Label Name="lblSSvDangAn" Text="archive path" />
<Label Name="lblSSvZhaoPian" Text="photo path" />
<Label Name="lblSZdPath" Text="2.terminal file save path:" />
<Label Name="lblSZdDangAn" Text="archive path" />
<Label Name="lblSZdZhaoPian" Text="photo path" />
<Label Name="lblSZysx" Text="notice" />
<Label Name="lblSZysx1" Text="1.Don't transfer illegal file acted as archive and photo, or else terminal might not upload and work unusual" />
<Label Name="lblSZysx2" Text="2.When writing archive, photo and FP file to terminal, please write photos and FP successfully then write archive" />
<Button Name="btnSendFile" Text="file transmission" />
<!--</TabPage>-->
<!--<TabPage Name="tpCheckTime">-->
<RadioButton Name="rbDatetimeNow" Text="no verify" />
<RadioButton Name="rbTimeUserDefined" Text="password verify" />
<Label Name="lblTimeHour" Text="hour" />
<Label Name="lblTimeMinute" Text="minute" />
<Button Name="btnChangeTime" Text="time synchronization" />
<!--</TabPage>-->
<!--<TabPage Name="tpFileDecode">-->
<Label Name="lblStringDecodeAndEncode" Text="1.string encrypt and decrypt:" />
<Label Name="lblDSourceString" Text=" original string" />
<Label Name="lblDDecodeString" Text="encrypted string" />
<Label Name="lblDUncodeString" Text="decrypted string" />
<Button Name="btnEncode" Text="encrypt" />
<Button Name="btnDecode" Text="decrypt" />
<Label Name="lblFileDecode" Text="2.file Decrypt:" />
<Label Name="lblEncodeFile" Text="original encrypt file" />
<Label Name="lblDecodeFile" Text="decrypted file" />
<Button Name="btnDecodeFile" Text="decrypt file " />
<Button Name="btnReadFile" Text="check file" />
<!--</TabPage>-->
<!--<TabPage Name="tpUdp">-->
<Label Name="lblNeedBindPort" Text="Need to bind Port No." />
<Label Name="lblUFx" Text="for example:" />
<Label Name="lblUFx1" Text="Communication Port No. setting is 3350,after binding its actual binded port is UDP 3351 that is 3350+1, used to intercept data sent by terminal to server" />
<Label Name="lblUZysx" Text="notice" />
<Label Name="lblUZysx1" Text="bind Port and set server IP etc when sending control command to terminal via ActiveX CortZd" />
<Label Name="lblUZdPic" Text="terminal picture information" />
<Button Name="btnBindPort" Text="bind Port" />
<Button Name="btnStartUDP" Text="display picture" />
<Button Name="btnEndUdp" Text="stop display" />
<!--</TabPage>-->
<!--<TabPage Name="tpReciveFromAny">-->
<Label Name="lblReciveAll" Text="several terminals communication simultaneously" />
<Label Name="lblRAJilu" Text="take record collection for example" />
<Label Name="lblStartIP" Text="beginning IP address" />
<Label Name="lblEndIP" Text="final IP address" />
<CheckBox Name="cbShowTX" Text="show communication form or not" />
<CheckBox Name="cbCloseTX" Text="automatically close communication form or not" />
<Label Name="lblRAZysx" Text="notice" />
<Label Name="lblRAZysx1" Text="1.This sample adopts multiprocess mode and call multiple samples to complete" />
<Label Name="lblRAZysx2" Text="2.record file save path..\Data\terminal IP address.wds" />
<Label Name="lblRAZysx3" Text="3.This sample is just for demo, don't send too many simultaneously" />
<Button Name="btnStartTx" Text="start collecting simultaneously" />
<!--</TabPage>-->
<Messages>
<Add Key="LineZdSuccess" Value="Connected" />
<Add Key="StartReciveFileToPcFromZd" Value="Start to read files from terminal to PC..." />
<Add Key="StartSendZhaoPianToZdFromPc" Value="Start to write photos from PC to terminal... *.pht" />
<Add Key="StartReTime" Value="Start to synchronous time..." />
<Add Key="ReadFileSuccess" Value="Succeed to read files! \r\n path:" />
<Add Key="BeginDeleteZdFile" Value="Start to delete terminal files..." />
<Add Key="WriteZhaoPianSuccess" Value="Succeed to write photos!" />
<Add Key="StartWriteFileFromPcToZd" Value="Start to write archive from PC to terminal... wdda.wts" />
<Add Key="WriteDangAnFileSuccess" Value="Succeed to write wdda.wts!" />
<Add Key="Disconnectioning" Value="Disconnecting terminal..." />
<Add Key="DeleteZdFileSuccess" Value="Deleted terminal files successfully!" />
<Add Key="ReTimeSuccess" Value="Time synchronization succeed.!" />
<Add Key="ConnectionFaileAndPleaseCheckPass" Value="Connection failed,please check the connection password and device info." />
<Add Key="DisconnectionFails" Value="Disconnect failed" />
<Add Key="ReadFileNotExists" Value="Files for reading from terminal is not existed!" />
<Add Key="WriteFileFails" Value="Exception to write files!" />
<Add Key="DeleteZdFileNotExistsOrStopSudden" Value="Deleted files in terminal is not existed or abort!" />
<Add Key="ConnectionFails" Value="Overtime\r\n Reason:1.Terminal Ip address is wrong 2.Network has something wrong 3.Port is wrong or disabled port" />
<Add Key="Disconnectioned" Value="Disconnected" />
<Add Key="ConnectionSuccess" Value="Connected" />
<Add Key="PassedAdmin" Value="Passed authentication" />
<Add Key="FileEncodeSuccess" Value="Decryption is successful!" />
<Add Key="SourceDecodeFileNotExists" Value="Original encrypted is not existed!Please check the path!" />
<Add Key="CurrentCommunicationPortIs" Value="Current communication port:" />
<Add Key="BindUdpPortIs" Value="Binded port is:UDP " />
<Add Key="BindPortFails" Value="Failed to bind port!\r\nReason:" />
<Add Key="Exception" Value="Exception!\r\nReason:" />
<Add Key="GetDataFromIP" Value="Have collected data from{0}!" />
<Add Key="StartIpIsBiggerThanEndIp" Value="The beginning ip must be less than the final IP!" />
</Messages>
</Language>

BIN
ClientForWEDS/ocx/mscomm32.ocx View File


BIN
ClientForWEDS/ocx/mswinsck.ocx View File


BIN
ClientForWEDS/ocx/w4commsv2.ocx View File


BIN
ClientForWEDS/tx.exe View File


Loading…
Cancel
Save