Summary of instant messages sent by the RTX client of Tencent (C #, VB6)

Source: Internet
Author: User

On the client, an RTX user sends messages to another RTX user!

My solution: deploy a WCF Service or WebService Service on the RTX server, and then the program can call the service on the client.

 

1, C #(4 DLL required for the server)

InterOP. rtxcapilib. dll

InterOP. rtxclient. dll

InterOP. rtxsapilib. dll

InterOP. rtxserverapi. dll

: Http://good.gd/1936542.htm

 

Server: (the above four DLL files need to be referenced)

Public String rtx_sendim (string ssender, string spwd, string smsg, string ssessionid, string sreceiver) {string serr = ""; try {rtxsapilib. rtxsapirootobj rootobj = new rtxsapirootobj (); // create the root object rootobj. sendim (ssender, spwd, sreceiver, smsg, ssessionid);} catch (exception ex) {serr = ex. message;} return serr ;}

Client:

            private void btnWCF_Click(object sender, EventArgs e)            {                AAA.Service se = new AAA.Service();                if (cboWcfAddress.Text != "")                    se.Url = cboWcfAddress.Text;                 Guid id = Guid.NewGuid();                string sessionId = "{" + id.ToString() + "}";                string sErr = se.RTX_SendIM(txtSender.Text, txtSenderPwd.Text, txtMsg.Text, sessionId, txtReceiver.Text);                if (!string.IsNullOrEmpty(sErr))                    MessageBox.Show(sErr);            }

2, VB6 (soaptoolkit needs to be installed on the client)

: Http://good.gd/1936572.htm

The server uses the server in the C # solution.

Client:

Private Sub btnSendWcf_Click()    On Error GoTo ERR    Dim sGuid As String    sGuid = CreateObject("Scriptlet.TypeLib").Guid     Dim soapClient As New SoapClient30    Dim text As String        soapClient.MSSoapInit cboWcfAddress.text & "?wsdl"     text = soapClient.RTX_SendIM(txtSender.text, txtSenderPwd.text, txtMsg.text, sGuid, txtReceiver.text)    If (text <> "") Then        MsgBox text    End If          Exit Sub ERR:    MsgBox ERR.DescriptionEnd Sub

 

Note:

Calling the WCF Service is the same as calling the WebService Service!

If one RTX user wants to send instant messages to multiple RTX users, use; (semicolon) to separate the content in txtreceiver!

 

I hope this article will help students in need!

If you have any questions, contact me.

Qq/MSN: jonse_2010@hotmail.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.