= null ; try { s = CommunClass.ConnectToServer(Host,Port) ; CommunClass.WriteCommandToSocket(s,"SENDTEXT") ; CommunClass.WriteCommandDescToSocket(s,"") ; CommunClass.WriteDynamicTextToSocket(s,Info,onsend) ; } catch (Exception e) { MessageBox.Show(e.Message) ; } finally { if (s != null) s.Close() ; } } }//end class 这样就可以使用一个线程发送文本了。 发送文件的方法也类似: private void StartSendFile(string strHost,int iPort,string strFil页码:[1] [2] [3] [4] [5] [6] [7] [8] 第3页、共8页 |