salam dostan kesi hast dastore remoter b4a ro behem yad bede?
kolan be che shekle ?
kolan be che shekle ?
No user |
Sub x_NewData (buffer() As Byte)
DoEvents
Dim xml As String
xml = BytesToString(buffer, 0, buffer.Length, "UTF8")
xml = xml.Replace("""", "'")
if xml.IndexOf("<message") >= 0 And xml.IndexOf("<body>") >= 0 Then
dim msgType as string = xml.Substring(xml.IndexOf("type='")+6)
msgType = msgType.Substring2(0,msgType.IndexOf("'"))
if msgType.ToLowerCase = "chat" Then
dim msgFUser as string = xml.Substring(xml.IndexOf("from='")+6)
msgFUser = msgFUser.Substring2(0,msgFUser.IndexOf("@"))
dim msgBody as string = xml.Substring(xml.IndexOf("<body>")+6)
msgBody = msgBody.Substring2(0,msgBody.IndexOf("</body>"))
if msgBody.ToLowerCase.StartsWith("a ") Then
Dim buffer1() As Byte
buffer1 = ("<message id='csharp_team' to='"& msgFUser &"@nimbuzz.com' type='chat'><thread>00101001</thread><body>http://avatar.nimbuzz.com/getAvatar?jid="& msgBody.ToLowerCase.Replace("a ","").Replace("@nimbuzz.com","") &"@nimbuzz.com</body><x xmlns='jabber:x:event'><composing/></x></message>").GetBytes("UTF8")
x.Write(buffer1)
End If
End If
End If
|
|