Access to OA in the use of PHP language for programming, as well as some of the IM operation is to use the socket way to communicate. A recent program needs to be done in C #, which involves this block, which is rewritten in C #, and requires further testing.
Using system;using system.collections.generic;using system.net;using system.net.sockets;using System.Text;using System.threading;namespace monitorflowworkandsubmit.dal{class Sendsocket {string myoa_tdim_addr = "127.0.0. 1 "; int myoa_tdim_port = xxxx; public string Send () {String rst = ""; IPAddress IP = ipaddress.parse (MYOA_TDIM_ADDR); Socket clientsocket = new socket (AddressFamily.InterNetwork, Sockettype.dgram,prot OCOLTYPE.UDP); try {clientsocket.connect (new IPEndPoint (IP, myoa_tdim_port)); Console.WriteLine ("conn OK"); } catch (Exception ex) {rst = "conn err! "; Return ex. ToString (); } try {string sendMessage = "X^a^admin"; Clientsocket.send (Encoding.ASCII.GetBytes (sendMessage)); } catch {Clientsocket.shutdown (Socketshutdown.both); Clientsocket.close (); Return "Send Error"; } return "OK"; } }}