|
|
@@ -1,13 +1,10 @@
|
|
|
-using NPOI.SS.Formula.Functions;
|
|
|
-using NPOI.SS.UserModel;
|
|
|
-using System;
|
|
|
+using System;
|
|
|
using System.Collections.Generic;
|
|
|
-using System.IO;
|
|
|
-using System.Net;
|
|
|
+using System.Drawing;
|
|
|
using System.Security.Cryptography;
|
|
|
using System.Text;
|
|
|
using System.Windows.Forms;
|
|
|
-using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
|
|
+using UMESDLLService;
|
|
|
|
|
|
namespace FileAnalysis
|
|
|
{
|
|
|
@@ -18,59 +15,10 @@ namespace FileAnalysis
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
}
|
|
|
-
|
|
|
+ TCPClient client;
|
|
|
private void Analysis_Click(object sender, EventArgs e)
|
|
|
{
|
|
|
- string url = "https://openapi.seewo.com/seewo-study-machine/device-manager/check-activate";
|
|
|
- HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create(url);
|
|
|
- webrequest.Method = "POST";
|
|
|
- webrequest.Timeout = 1000;
|
|
|
- webrequest.ContentType = "application/x-www-form-urlencoded";
|
|
|
- string secret = "QmxcghPaupQjjSOTV3NJLkPeyycEBuYk";
|
|
|
- System.Collections.Hashtable pars = new System.Collections.Hashtable();
|
|
|
- string sign = "x-sw-app-id3a1252d81dff4fd3b1ece153b3a9cb71x-sw-req-path/seewo-study-machine/device-manager/check-activatex-sw-version2";
|
|
|
- webrequest.Headers.Add("x-sw-app-id", "3a1252d81dff4fd3b1ece153b3a9cb71"); //必填
|
|
|
- webrequest.Headers.Add("x-sw-sign", GETMD5(secret + sign + secret));//必填
|
|
|
- webrequest.Headers.Add("x-sw-req-path", "/seewo-study-machine/device-manager/check-activate");//必填
|
|
|
- webrequest.Headers.Add("x-sw-version", "2");//必填
|
|
|
- //webrequest.Headers.Add("x-sw-sign-type", "");
|
|
|
- //webrequest.Headers.Add("x-sw-sign-headers", "");
|
|
|
- //webrequest.Headers.Add("x-sw-timestamp", "");
|
|
|
- //webrequest.Headers.Add("x-sw-content-md5", "");c
|
|
|
- pars.Add("sn", "{sn:123}");
|
|
|
- string buffer = "";
|
|
|
- //发送POST数据
|
|
|
- if (!(pars == null || pars.Count == 0))
|
|
|
- {
|
|
|
- foreach (string key in pars.Keys)
|
|
|
- {
|
|
|
- buffer = buffer + "&" + key + "=" + pars[key].ToString();
|
|
|
- }
|
|
|
- byte[] data = Encoding.UTF8.GetBytes(buffer);
|
|
|
- using (Stream stream = webrequest.GetRequestStream())
|
|
|
- {
|
|
|
- stream.Write(data, 0, data.Length);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- string[] values = webrequest.Headers.GetValues("Content-Type");
|
|
|
- WebResponse myResponse = webrequest.GetResponse();
|
|
|
-
|
|
|
- using (Stream resStream = myResponse.GetResponseStream())//得到回写的流
|
|
|
- {
|
|
|
- StreamReader newReader = new StreamReader(myResponse.GetResponseStream(), Encoding.UTF8);
|
|
|
-
|
|
|
- string Content = newReader.ReadToEnd();
|
|
|
- ReturnData.Text = Content;
|
|
|
- Dictionary<string, object> dic = new Dictionary<string, object>();
|
|
|
- //dic = BaseUtil.ToDictionary(Content);
|
|
|
- //if (!dic.ContainsKey("erpaccount"))
|
|
|
- //{
|
|
|
- // oMsg = dic["reason"].ToString();
|
|
|
- // return false;
|
|
|
- //}
|
|
|
- newReader.Close();
|
|
|
- }
|
|
|
+ client.Send("A001H10G1111111111111111110111100111111111111111111111111111111111111111111111111111111111111111111111111111 ");
|
|
|
}
|
|
|
|
|
|
private string GETMD5(string password)
|
|
|
@@ -144,10 +92,24 @@ namespace FileAnalysis
|
|
|
}
|
|
|
return ReturnData.ToArray();
|
|
|
}
|
|
|
-
|
|
|
+ string nextLine;
|
|
|
private void Form1_Load(object sender, EventArgs e)
|
|
|
{
|
|
|
+ client = new TCPClient("172.16.15.10", "1030", "", "");
|
|
|
+ //label1.BackColor = Color.GreenYellow;
|
|
|
+ //string json = "";
|
|
|
+ //string json1 = "";
|
|
|
+ //MESHelper mes = new MESHelper();
|
|
|
+ //mes.GetMobileAllInfo("Q32024040002", out json1, out json);
|
|
|
+ //////mes.GetMobileAllInfo("F45112235030001", out json1, out json);
|
|
|
+ //Console.WriteLine(json1);
|
|
|
+ //Console.WriteLine(json);
|
|
|
|
|
|
+ //StreamReader sR = new StreamReader(@"C:\Users\callm\Desktop\Android\036653943B010A11-C.txt", Encoding.Default);
|
|
|
+ //while ((nextLine = sR.ReadLine()) != null)
|
|
|
+ //{
|
|
|
+ // ReturnData.AppendText(nextLine.ToString() + "\n");
|
|
|
+ //}
|
|
|
}
|
|
|
}
|
|
|
}
|