123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Diagnostics;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using UMES.DLLService;
- namespace TestProject
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- DataHelper dh = new DataHelper();
- MESHelper mes = new MESHelper();
- string Err = "";
- string Json = "";
- mes.GetMobileAllInfo("FG09P1M1C840000014", out Json, out Err);
- mes.GetMobileAllInfo("FG01P1M2C7R0000132", out Json, out Err);
- mes.GetMobileAllInfo("FG01P1M2C7R0000160", out Json, out Err);
- mes.GetMobileAllInfo("FG01P1M2C7R0000182", out Json, out Err);
- mes.GetMobileAllInfo("FG01P1M2C7R0000198", out Json, out Err);
- //if (mes.CheckRoutePassed("92101BD6QD60099823B4", "ZZ_A_MT1", out Err))
- //{
- // if (mes.SetStepFinish("PING-2021080001", "ZZ_A_MT1", "92101BD6QD60099823B4", "OK", "NG", "ZZ_A_MT1", "1000", out Err))
- // {
- // }
- // else
- // {
- // Console.WriteLine(Err);
- // }
- //}
- //else {
- // Console.WriteLine(Err);
- //}
- //string Err = "";
- //string json = "";
- ////exec(@"C:\Windows\System32\cmd.exe", " wmic os get SerialNumber /value");
- //List<string> add = new List<string>();
- //DataTable dt = (DataTable)dh.ExecuteSql("select ms_sncode from makeserial where ms_makecode='MSQ21070033' and ms_mac is null", "select");
- //for (int i = 0; i < dt.Rows.Count; i++)
- //{
- // string mac = "";
- // string bt = "";
- // string code1 = "";
- // string code2 = "";
- // string code3 = "";
- // if (mes.GetAddressRangeByMO(dt.Rows[i]["ms_sncode"].ToString(), out mac,out bt,out code1,out code2,out code3, out Err))
- // {
- // Console.WriteLine(mac);
- // Console.WriteLine(bt);
- // Console.WriteLine(code1);
- // Console.WriteLine(code2);
- // Console.WriteLine(code3);
- // }
- // else
- // {
- // Console.WriteLine(Err);
- // }
- //}
- }
- public void exec(string exePath, string parameters)
- {
- Process process = new Process();
- process.StartInfo.FileName = "cmd.exe";
- process.StartInfo.UseShellExecute = false;
- process.StartInfo.RedirectStandardInput = true;
- process.StartInfo.RedirectStandardOutput = true;
- process.StartInfo.CreateNoWindow = true;
- process.StartInfo.RedirectStandardError = true;//重定向标准错误输出
- process.Start();
- process.StandardInput.WriteLine(" wmic os get SerialNumber /value"); //打开到rtt目录
- process.StandardInput.WriteLine(" wmic bios get SMBIOSBIOSVersion / value"); //打开到rtt目录
-
- process.StandardInput.Close(); //运行完毕关闭控制台输入
- string add = process.StandardOutput.ReadToEnd(); //读取输出的信息
- Console.WriteLine(add);
- process.Close();
- }
- }
- }
|