admin管理员组

文章数量:1532519

2024年2月8日发(作者:)

using ;using ;namespace 充电桩测试软件{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void label10_Click(object sender, EventArgs e){}TcpListener listener;delegate void SetTextCallBack(TextBox txt, string text);private void button1_Click(object sender, EventArgs e){d = false;Socket socket = new Socket(etwork, , );IPEndPoint endPoint = new IPEndPoint((), 32());(endPoint);(10);Thread thread = new Thread(Listen);ground = true;(socket);}public void SetControlTextInfo(string msg){TextBox txtMsgInfo = new TextBox();txtMsgInfo = textBox2;foreach (Control item in ls){if(item is TabPage){

// //if (jihuoCount > 0)// //{// // string strDateTime = TimeToCP56Time2a();// // byte[] bt_DateTime = es(strDateTime);// // int countTime = (bt_DateTime);// //}//}}SetControlTextInfo(msg);}}void Listen(object o) //接受客户端传信息{try{Socket socketWatch = o as Socket;while (true){socketSend = ();SetText(textBox2,ng() ":" " ok");string name = ng();(name, socketSend);//键值对传值Thread thread = new Thread(Recive);foreach (var item in SocketDic){if(ns("192.168.1.79")){}}ground = true;(socketSend);}}catch

private readonly string yjzkb = "43 9F";private readonly string ewmAddress = "44 9F";//结束标识private readonly string EndFlag = " 16";//CRC校验码获取public static string CRCCalc(string data){//int sum = 0;string[] str16 = (' ');for (int i = 0; i < ; i ){sum = 32(str16[i], 16);}int resInt = sum % 256;string res16 = ng(resInt, 16).ToUpper();return " " res16;}public string GetSendMsg(string Code){string CRC = CRCCalc(ReadTCPInfo Code);return ReadTCPInfo Code CRC EndFlag;}public string ss(string ReciveDate){string s1 = "";return s1;// return ip;}public TCPService service = new TCPService();public Dictionary dicCodeToNumber = new Dictionary();private void Form1_Load(object sender, EventArgs e){cive = ss;

orIllegalCrossThreadCalls = false;("30 9F", "10 00");("31 9F", "12 00");("01 9F", "14 00");("02 9F", "16 00");("36 9F", "18 00");("33 9F", "1A 00");("37 9F", "1C 00");("3A 9F", "1E 00");("38 9F", "20 00");("3C 9F", "22 00");("08 9F", "28 00");("09 9F", "2A 00");("0B 9F", "2C 00");("0D 9F", "2E 00");("0A 9F", "30 00");("0E 9F", "32 00");("0C 9F", "34 00");("04 9F", "36 00");// ("39 9F", "");//校正时间("41 9F", "3C 00");("10 9F", "3E 00");("11 9F", "40 00");("12 9F", "42 00");("13 9F", "44 00");("14 9F", "46 00");("15 9F", "48 00");("16 9F", "4A 00");("17 9F", "4C 00");("18 9F", "4E 00");("19 9F", "50 00");("21 9F", "52 00");("34 9F", "54 00");("35 9F", "56 00");

(((((int)eek % 7) & 0x03) << 5 | ( & 0x1F)).ToString("X2") " ");(( & 0x0F).ToString("X2") " ");(( - 2000).ToString("X2") " ");return ng();}private void button72_Click(object sender, EventArgs e){ervice("192.168.1.79", 9995);//string ss= TimeToCP56Time2a();}private void button73_Click(object sender, EventArgs e){SendMsg("68 04 07 00 00 00");//string strJiHuo = "68 04 07 00 00 00";// = e strJiHuo;//byte[] bt_JiHuo = es(strJiHuo);//int jihuoCount = (bt_JiHuo);}private void button78_Click(object sender, EventArgs e){string strDateTime = TimeToCP56Time2a();string TimeInfo = "68 12 00 00 02 00 67 01 07 00 00 00 00 " strDateTime;SendMsg(TimeInfo);// = e TimeInfo;//byte[] bt_DateTime = es(TimeInfo);//int countTime = (bt_DateTime);}public static byte[] HexStringToByteArray(string s){s = e(" ", "");byte[] buffer = new byte[ / 2];for (int i = 0; i < ; i = 2)buffer[i / 2] = (byte)(ing(i, 2), 16);return buffer;

}}}

本文标签: 充电源码接受键值