| | |
| | | using System.Data; |
| | | using Yw.WinFrmUI; |
| | | using Yw; |
| | | |
| | | namespace IBox.WinFrmUI |
| | | { |
| | | public partial class IBoxFormSystemInfo : DocumentPage |
| | | { |
| | | private string startCode = "[&start&]"; |
| | | private string endCode = "[&end&]"; |
| | | private string paramCode = "[¶m&]"; |
| | | private string getstoreCode = "getstore"; |
| | | |
| | | public IBoxFormSystemInfo() |
| | | { |
| | | this.PageTitle.Caption = "设备信息"; |
| | |
| | | private void EboxFormSystemInfo_Load(object sender, EventArgs e) |
| | | { |
| | | Thread.Sleep(500); |
| | | SendText(startCode + getstoreCode + paramCode + endCode); |
| | | SendText(IBoxHelper.startCode + IBoxHelper.getstoreCode + IBoxHelper.paramCode + IBoxHelper.endCode); |
| | | } |
| | | public event EventHandler<string> SendData; |
| | | private void SendText(string content) |
| | | { |
| | | SendData?.Invoke(null, content); |
| | | if (SendData != null) |
| | | { |
| | | SendData?.Invoke(null, content); |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (IBoxHelper.Ping()) |
| | | { |
| | | var smsg = content.Split(new string[] { IBoxHelper.paramCode }, StringSplitOptions.RemoveEmptyEntries); |
| | | if (smsg.Length < 2) |
| | | { |
| | | return; |
| | | } |
| | | switch (smsg[0].Trim()) |
| | | { |
| | | case IBoxHelper.getstoreCode: |
| | | { |
| | | var order = IBoxHelper.HttpGet(content); |
| | | var result = IBoxHelper.GetContent(order); |
| | | if (!string.IsNullOrEmpty(result)) |
| | | { |
| | | var model = JsonHelper.Json2Object<SystemInfoViewModel>(result); |
| | | BindData(model, false); |
| | | } |
| | | break; |
| | | } |
| | | default: |
| | | IBoxHelper.HttpGet(content); |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBoxHelper.ShowWarning("网络连接失败,请检查网络"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |