예제 #1
0
 private void sendMessage(string code)
 {
     try
     {
         code = "$" + DesCode.DESEncode(code.Substring(1, code.Length - 2), "YN200916") + "*";
         byte[]     sendbytes  = Encoding.UTF8.GetBytes(code);
         var        path       = AppDomain.CurrentDomain.BaseDirectory + "config.ini";
         IPEndPoint remoteIpep = new IPEndPoint(IPAddress.Parse(INIFile.GetValue("cfg", "equipmentip", path)), 7015); // 发送到的IP地址和端口号
         LogHelper.Log.Info("Q-----------");
         int i = udpcRecv.Send(sendbytes, sendbytes.Length, remoteIpep);
     }
     catch (System.Exception ex)
     {
         //
     }
 }
예제 #2
0
        private void sendMessage(string code)
        {
            try
            {
                code = "$" + DesCode.DESEncode(code.Substring(1, code.Length - 2), "YN200916") + "*";
                byte[] sendbytes = Encoding.UTF8.GetBytes(code);

                IPEndPoint remoteIpep = new IPEndPoint(IPAddress.Parse(NEIni.ReadValue(".\\config.ini", "cfg", "equipmentip", "")), 7015); // 发送到的IP地址和端口号
                NELog.WriteLog("Q-----------");
                int i = udpcRecv.Send(sendbytes, sendbytes.Length, remoteIpep);
            }
            catch (System.Exception ex)
            {
                //
            }
        }