10-11-16, 10:05 PM
سلام عليكم
اريد تعديل ع كود من برنامج ليكن جاهزاً
حاولت كل الطرق ولكن تعبت ولجأت الي الله ثم لكم
بمساعدتي
الكود كما هو موضح بصورة
يعطي خطأ
ما السبب؟؟
وشكراً
Imports agsXMPP
Imports agsXMPP.Xml.Dom
Imports agsXMPP.protocol.client
Imports System.Runtime.CompilerServices
Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports agsXMPP.protocol.x.muc
Public Class Form1
Dim target As String
Private msg As String
Private a As String
Private a1 As String
Public mem As String()
Public meem As String()
Public Shared emad As agsXMPP.XmppClientConnection = New agsXMPP.XmppClientConnection()
Private Sub LogInButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton1.Click
emad = New agsXMPP.XmppClientConnection
With emad
.Server = "nimbuzz.com"
.ConnectServer = "o.nimbuzz.com"
.Open(LogInUserTextBox1.Text, LogInUserTextBox2.Text) 'id + password
.Resource = ("Nimbuzz_Symbian" & Me.Generatecode())
.Status = ("TEST My Soft")
.ClientVersion = ("2.2.0")
.Port = "5222"
AddHandler .OnClose, AddressOf dc
AddHandler .OnReadXml, AddressOf xmlwlcowner
AddHandler .OnReadXml, AddressOf xmlwlcadmin
AddHandler .OnReadXml, AddressOf xmlban
AddHandler .OnReadXml, AddressOf xmlip
AddHandler .OnReadXml, AddressOf xmlmem
AddHandler .OnReadXml, AddressOf xmlkick
AddHandler .OnReadXml, AddressOf xmlvis
AddHandler .OnReadXml, AddressOf xml2
AddHandler .OnReadXml, AddressOf Xml3
AddHandler .OnReadXml, AddressOf Xml4
AddHandler .OnReadXml, AddressOf Xml5
AddHandler .OnReadXml, AddressOf Xml6
AddHandler .OnReadXml, AddressOf Xml7
AddHandler .OnLogin, AddressOf loged
AddHandler .OnAuthError, AddressOf wrong
AddHandler .OnMessage, AddressOf mesg
AddHandler .OnPresence, AddressOf rec
AddHandler .OnPresence, AddressOf onjoin
AddHandler .OnMessage, AddressOf cnt_OnMessage
End With
End Sub
Private Sub onjoin(ByVal sender As Object, ByVal pre As Presence)
On Error Resume Next
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New PresenceHandler(AddressOf Me.onjoin), New Object() {sender, pre})
Else
If pre.From.Server.StartsWith("conference") Then
If pre.Type = PresenceType.available Then
If Me.LogInOnOffSwitch18.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
Dim sry As String() = Nothing
sry = "chmz#fownz#chgz#bcz".Split(New Char() {"#"c})
Dim sryy As New Random
Dim sryyyy As String = sry(sryy.Next(sry.Length))
target = pre.From.Resource
emad.Send("<message to='" + room.Text + "@conference.nimbuzz.com' type='groupchat'><body>/vg " + sryyyy + " " + target + "</body></message>")
emad.Send("<message to='" + room.Text + "@conference.nimbuzz.com' type='groupchat'><body>Auto gift {9/Point} to " & " ↦ " + pre.From.Resource + "</body></message>")
End If
End If
End If
End If
End Sub
Private Sub xmlvis(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.xmlvis), New Object() {RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(sender))), a})
Else
a = Strings.Replace(a, """", "'", 1, -1, CompareMethod.Text)
If (Me.LogInOnOffSwitch4.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled AndAlso ((Strings.InStr(a, "affiliation='None'", CompareMethod.Text) And (Strings.InStr(a, "role='participant'", CompareMethod.Text) Or -(((Strings.InStr(a, "type='available'", CompareMethod.Text) > 0) < False) > False))) > 0)) Then
Dim str9 As String = a.Substring((a.IndexOf("jid='") + 5))
str9 = str9.Substring(0, (str9.IndexOf("@") - 0))
Try
emad.Send(String.Concat(New String() {"<iq type='set' to='", Me.room.Text, "@conference.nimbuzz.com' id='badbuzz'><query xmlns='http://jabber.org/protocol/muc#admin'><item nick='", str9, "' role='visitor' /></query></iq>"}))
Catch exception9 As Exception
ProjectData.SetProjectError(exception9)
Dim exception5 As Exception = exception9
ProjectData.ClearProjectError()
ProjectData.ClearProjectError()
End Try
End If
End If
End Sub
Private Sub xmlkick(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.xmlkick), New Object() {RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(sender))), a})
Else
a = Strings.Replace(a, """", "'", 1, -1, CompareMethod.Text)
If (Me.LogInOnOffSwitch3.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled AndAlso ((Strings.InStr(a, "affiliation='None'", CompareMethod.Text) And (Strings.InStr(a, "role='participant'", CompareMethod.Text) Or -(((Strings.InStr(a, "type='available'", CompareMethod.Text) > 0) < False) > False))) > 0)) Then
Dim str9 As String = a.Substring((a.IndexOf("jid='") + 5))
str9 = str9.Substring(0, (str9.IndexOf("@") - 0))
Try
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='itemmuc'><query xmlns='http://jabber.org/protocol/muc#admin'><item role='none' nick='", str9, "'><reason>: loopeto</reason></item></query></iq>"}))
Catch exception9 As Exception
ProjectData.SetProjectError(exception9)
Dim exception5 As Exception = exception9
ProjectData.ClearProjectError()
ProjectData.ClearProjectError()
End Try
End If
End If
End Sub
Private Sub xmlmem(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.xmlmem), New Object() {RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(sender))), a})
Else
a = Strings.Replace(a, """", "'", 1, -1, CompareMethod.Text)
If (Me.LogInOnOffSwitch2.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled AndAlso ((Strings.InStr(a, "affiliation='None'", CompareMethod.Text) And (Strings.InStr(a, "role='participant'", CompareMethod.Text) Or -(((Strings.InStr(a, "type='available'", CompareMethod.Text) > 0) < False) > False))) > 0)) Then
Dim str9 As String = a.Substring((a.IndexOf("jid='") + 5))
str9 = str9.Substring(0, (str9.IndexOf("@") - 0))
Try
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='itemmuc'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='member' jid='", str9, "@nimbuzz.com'/> </query> </iq>"}))
Me.ListBox5.Items.Add(str9)
Catch exception9 As Exception
ProjectData.SetProjectError(exception9)
Dim exception5 As Exception = exception9
ProjectData.ClearProjectError()
ProjectData.ClearProjectError()
End Try
End If
End If
End Sub
Private Sub cnt_OnMessage(ByVal sender As Object, ByVal Msg As Message)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New MessageHandler(AddressOf Me.cnt_OnMessage), New Object() {sender, Msg})
ElseIf ((Msg.Body.ToLower = "الكلمات السيئة") Or (Msg.Body.ToLower = "الكلمات السيئة")) Then 'المشكلة هنا
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", Msg.From.Resource.Trim, " Dahaneto gereftam ta dg to bashi harfe zesht nazani :-| To kaf bash :p:D</body></message>"}))
emad.Send(String.Concat(New String() {"<iq type='set' to='", Me.room.Text, "@conference.nimbuzz.com' id='mir_437'><query xmlns='http://jabber.org/protocol/muc#admin'><item nick='", Msg.From.Resource.Trim, "' role='visitor' /></query></iq>"}))
End If
End Sub
Private Sub xmlwlcadmin(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.xmlwlcadmin), New Object() {RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(sender))), a})
Else
a = Strings.Replace(a, """", "'", 1, -1, CompareMethod.Text)
If (Me.LogInOnOffSwitch11.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled AndAlso ((Strings.InStr(a, "affiliation='Admin'", CompareMethod.Text)))) Then
Dim str As String = a.Substring((a.IndexOf("jid='") + 5))
Dim str2 As String = (str.Substring(0, (str.IndexOf("@") - 0)) & " (f) ")
Try
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>Wlc Admin ♥", str2, "</body></message>"}))
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
ProjectData.ClearProjectError()
ProjectData.ClearProjectError()
End Try
End If
End If
End Sub
Private Sub xmlwlcowner(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.xmlwlcowner), New Object() {RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(sender))), a})
Else
a = Strings.Replace(a, """", "'", 1, -1, CompareMethod.Text)
If (Me.LogInOnOffSwitch11.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled AndAlso ((Strings.InStr(a, "affiliation='Owner'", CompareMethod.Text)))) Then
Dim str As String = a.Substring((a.IndexOf("jid='") + 5))
Dim str2 As String = (str.Substring(0, (str.IndexOf("@") - 0)) & " (f) ")
Try
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>Wlc Owner ♥", str2, "</body></message>"}))
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
ProjectData.ClearProjectError()
ProjectData.ClearProjectError()
End Try
End If
End If
End Sub
Private Sub rec(ByVal sender As Object, ByVal pres As Presence)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New PresenceHandler(AddressOf Me.rec), New Object() {sender, pres})
ElseIf ((pres.Type = PresenceType.available) AndAlso Me.LogInOnOffSwitch10.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled) Then
Dim strArray As String() = "X#bot#BOT#kpv".Split(New Char() {"#"c})
Dim index As Integer = 0
index = 0
Do While (index <= (strArray.GetUpperBound(0) - 1))
If Convert.ToString(pres).Contains(strArray(index)) Then
If Me.LogInOnOffSwitch10.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='outcast' jid='", pres.From.Resource, "@nimbuzz.com' /></query></iq>"}))
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", pres.From.Resource, " : Gomsho Birun :@</body></message>"}))
Exit Do
End If
If Me.LogInOnOffSwitch10.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>/ban f ", pres.From.Resource, "</body></message>"}))
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", pres.From.Resource, " : Boro Gom Sho Biron :@ IP Ban Shod :P</body></message>"}))
Exit Do
End If
If Me.LogInOnOffSwitch10.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='781'><query xmlns='http://jabber.org/protocol/muc#admin'><item role='none' nick='", pres.From.Resource, "'><reason>: loopo boro havakhori:D</reason></item></query></iq>"}))
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", pres.From.Resource, " : Nayomade Boro Birun :D</body></message>"}))
Exit Do
End If
If Me.LogInOnOffSwitch10.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<iq type='set' to='", Me.room.Text, "@conference.nimbuzz.com' id='347'><query xmlns='http://jabber.org/protocol/muc#admin'><item nick='", pres.From.Resource, "' role='visitor' /></query></iq>"}))
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", pres.From.Resource, " : Wb. Pas Chera Harf Nmizani :D ?</body></message>"}))
Exit Do
End If
End If
index += 1
Loop
End If
End Sub
Private Sub xmlban(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.xmlban), New Object() {RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(sender))), a})
Else
'auto ban normail
a = Strings.Replace(a, """", "'", 1, -1, CompareMethod.Text)
If (Me.LogInOnOffSwitch17.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled AndAlso ((Strings.InStr(a, "affiliation='none'", CompareMethod.Text) And (Strings.InStr(a, "role='participant'", CompareMethod.Text) Or -(((Strings.InStr(a, "type='available'", CompareMethod.Text) > 0) < False) > False))) > 0)) Then
Dim str As String = a.Substring((a.IndexOf("jid='") + 5))
str = str.Substring(0, (str.IndexOf("@") - 0))
Try
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>/ban", str, "</body></message>"}))
Me.ListBox4.Items.Add(str)
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
ProjectData.ClearProjectError()
ProjectData.ClearProjectError()
End Try
End If
End If
End Sub
Private Sub xmlip(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.xmlip), New Object() {RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(sender))), a})
Else
'auto ban ip
a = Strings.Replace(a, """", "'", 1, -1, CompareMethod.Text)
If (Me.LogInOnOffSwitch1.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled AndAlso ((Strings.InStr(a, "affiliation='none'", CompareMethod.Text) And (Strings.InStr(a, "role='participant'", CompareMethod.Text) Or -(((Strings.InStr(a, "type='available'", CompareMethod.Text) > 0) < False) > False))) > 0)) Then
Dim str As String = a.Substring((a.IndexOf("jid='") + 5))
str = str.Substring(0, (str.IndexOf("@") - 0))
Try
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>/ban f ", str, "</body></message>"}))
Me.ListBox4.Items.Add(str)
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
ProjectData.ClearProjectError()
ProjectData.ClearProjectError()
End Try
End If
End If
End Sub
Private Sub xml2(ByVal sender As Object, ByVal v As String)
If MyBase.InvokeRequired = True Then
MyBase.BeginInvoke(New agsXMPP.XmlHandler(AddressOf xml2), New Object() {sender, v})
Else
On Error Resume Next
v = Replace(v, """", "'")
If (InStr(v, "Enter the right answer to start chatting.", CompareMethod.Text) <> 0) Then
a = v.Substring(v.IndexOf("Enter the right answer to start chatting.") + 42)
a = a.Substring(0, a.IndexOf("<") - 0)
Form2.P1.ImageLocation = a
Form2.Show()
End If
If InStr(v, "code='503'", CompareMethod.Text) <> 0 Then
MsgBox("Room IS Full", MsgBoxStyle.Critical, "Error 503")
End If
If InStr(v, "code='307'", CompareMethod.Text) <> 0 Then
MsgBox("ID Kicked", MsgBoxStyle.Critical, "Error 307")
End If
If InStr(v, "role='visitor'", CompareMethod.Text) <> 0 Then
MsgBox("ID 1 Is Visitor", MsgBoxStyle.Critical, "Error Visitor")
End If
End If
End Sub
Private Sub rooom(ByVal sender As Object, ByVal msg As Message)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New agsXMPP.protocol.client.MessageHandler(AddressOf Me.rooom), New Object() {sender, msg})
If msg.Type = MessageType.chat AndAlso msg.HasTag("body") Then
Else
If Me.LogInOnOffSwitch15.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
ElseIf ((msg.Body.ToLower = "زب") Or (msg.Body.ToLower = "كس")) Then
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", msg.From.Resource.Trim, " Dahaneto gereftam ta dg to bashi harfe zesht nazani :-| To kaf bash :p:D</body></message>"}))
emad.Send(String.Concat(New String() {"<iq type='set' to='", Me.room.Text, "@conference.nimbuzz.com' id='mir_437'><query xmlns='http://jabber.org/protocol/muc#admin'><item nick='", msg.From.Resource.Trim, "' role='visitor' /></query></iq>"}))
End If
If Me.LogInOnOffSwitch15.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<iq xmlns='jabber:client' to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='apple'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='outcast' jid='", msg.From.Resource.Trim, "@nimbuzz.com' /></query></iq>"}))
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", msg.From.Resource.Trim, " : Khafe sho :@</body></message>"}))
End If
If Me.LogInOnOffSwitch12.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>/ban f ", msg.From.Resource.Trim, "</body></message>"}))
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", msg.From.Resource.Trim, " : Boro Gom Sho Biron :@ IP Ban Shod :P</body></message>"}))
End If
If Me.LogInOnOffSwitch14.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='itemmuc'><query xmlns='http://jabber.org/protocol/muc#admin'><item role='none' nick='", msg.From.Resource.Trim, "'><reason>: loopeto</reason></item></query></iq>"}))
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", msg.From.Resource.Trim, " : Boro Birun ye Havayi Bokhor Biya :D</body></message>"}))
End If
If Me.LogInOnOffSwitch13.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<iq type='set' to='", Me.room.Text, "@conference.nimbuzz.com' id='badbuzz'><query xmlns='http://jabber.org/protocol/muc#admin'><item nick='", msg.From.Resource.Trim, "' role='visitor' /></query></iq>"}))
emad.Send(String.Concat(New String() {"<message to='", Me.room.Text, "@conference.nimbuzz.com' type='groupchat'><body>", msg.From.Resource.Trim, " : Sedat Chera Dar nmiyad ? :D</body></message>"}))
End If
End If
End If
End Sub
Public Sub Xml6(ByVal sender As Object, ByVal xml As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.Xml6), New Object() {sender, xml})
Else
Try
xml = xml.Replace("""", "'")
Try
If ((xml.IndexOf("<query xmlns='http://jabber.org/protocol/muc#admin'>") >= 0) AndAlso (xml.IndexOf("affiliation='member'") >= 0)) Then
xml = xml.Substring((xml.IndexOf("<item jid='") + 11))
xml = xml.Replace("' affiliation='member' /></query></iq>", "").Replace("' affiliation='member' />", "")
xml = xml.Replace("role='participant' />", "")
Me.meem = Strings.Split(xml, "<item jid='", -1, CompareMethod.Binary)
Me.ListBox3.Items.Clear()
Dim i As Integer = Me.meem.GetLowerBound(0)
Do While (i <= Me.meem.GetUpperBound(0))
Me.ListBox3.Items.Add(Me.meem(i))
LogInButton20.Text = ("Total member" & Me.ListBox3.Items.Count)
i += 1
Loop
End If
Catch ex As Exception
End Try
Catch ex As Exception
End Try
End If
End Sub
Public Sub Xml5(ByVal sender As Object, ByVal xml As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.Xml5), New Object() {sender, xml})
Else
Try
xml = xml.Replace("""", "'")
Try
If ((xml.IndexOf("<query xmlns='http://jabber.org/protocol/muc#admin'>") >= 0) AndAlso (xml.IndexOf("affiliation='outcast'") >= 0)) Then
xml = xml.Substring((xml.IndexOf("<item jid='") + 11))
xml = xml.Replace("' affiliation='outcast' /></query></iq>", "").Replace("' affiliation='outcast' />", "")
xml = xml.Replace("role='participant' />", "")
Me.mem = Strings.Split(xml, "<item jid='", -1, CompareMethod.Binary)
Me.ListBox2.Items.Clear()
Dim i As Integer = Me.mem.GetLowerBound(0)
Do While (i <= Me.mem.GetUpperBound(0))
Me.ListBox2.Items.Add(Me.mem(i))
LogInButton18.Text = ("Total ban" & Me.ListBox2.Items.Count)
i += 1
Loop
End If
Catch ex As Exception
End Try
Catch ex As Exception
End Try
End If
End Sub
Private Sub mesg(ByVal sender As Object, ByVal msg As Message)
If MyBase.InvokeRequired = True Then
MyBase.BeginInvoke(New MessageHandler(AddressOf mesg), New Object() {sender, msg})
Else
If msg.Type = MessageType.groupchat Then
LogInRichTextBox1.AppendText(msg.From.Resource + " : " + msg.Body + vbNewLine)
End If
End If
End Sub
Private Sub Xml3(ByVal sender As Object, ByVal a As String)
On Error Resume Next
If MyBase.InvokeRequired = True Then
MyBase.BeginInvoke(New agsXMPP.XmlHandler(AddressOf Xml3), New Object() {sender, a})
Else
a = Replace(a, """", "'")
If (InStr(a, "affiliation=")) <> 0 Then
If Not (InStr(a, "type='groupchat'")) <> 0 Then
If Not (InStr(a, "role='none'")) <> 0 Then
If Not (InStr(a, "actor jid=")) <> 0 Then
Dim user As String
user = a.Substring(a.IndexOf("jid='") + 5)
user = user.Substring(0, user.IndexOf("@") - 0)
If user.ToString = "admin" Then
Return
End If
ListBox1.Items.Add(user)
Label10.Text = "User room : " & ListBox1.Items.Count.ToString()
End If
End If
End If
End If
End If
End Sub
Private Sub Xml4(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.Xml4), New Object() {RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(RuntimeHelpers.GetObjectValue(sender))), a})
Else
Try
Application.DoEvents()
a = a.ToLower
a = a.Replace("""", "'")
If (((a.IndexOf(("@conference.nimbuzz.com/" & Me.LogInUserTextBox3.Text & "'"), StringComparison.OrdinalIgnoreCase) + 1) <> 0) AndAlso ((a.IndexOf("ip/on", StringComparison.OrdinalIgnoreCase) + 1) <> 0)) Then
Me.LogInCheckBox2.Checked = True
emad.Send(("<message to='" & Me.room.Text & "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>Ban ip Start ✔ / حظر الايبي نشط ✔ </body></message>"))
End If
Catch exception1 As Exception
ProjectData.SetProjectError(exception1)
Dim exception As Exception = exception1
ProjectData.ClearProjectError()
End Try
Try
Application.DoEvents()
a = a.ToLower
a = a.Replace("""", "'")
If (((a.IndexOf(("@conference.nimbuzz.com/" & Me.LogInUserTextBox3.Text & "'"), StringComparison.OrdinalIgnoreCase) + 1) <> 0) AndAlso ((a.IndexOf("ip/off", StringComparison.OrdinalIgnoreCase) + 1) <> 0)) Then
Me.LogInCheckBox2.Checked = False
Try
emad.Send(("<message to='" & Me.room.Text & "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>Ban ip Stoped ✘ / حظر الايبي متوقف ✘</body></message>"))
Catch exception20 As Exception
ProjectData.SetProjectError(exception20)
Dim exception3 As Exception = exception20
ProjectData.ClearProjectError()
ProjectData.ClearProjectError()
End Try
End If
Catch exception21 As Exception
ProjectData.SetProjectError(exception21)
Dim exception4 As Exception = exception21
ProjectData.ClearProjectError()
End Try
End If
End Sub
Private Sub dc(ByVal sender As Object)
If MyBase.InvokeRequired = True Then
MyBase.BeginInvoke(New ObjectHandler(AddressOf dc), New Object() {sender})
Else
'Dc Contact id
LogInUserTextBox1.BackColor = Color.Yellow
LogInUserTextBox2.BackColor = Color.Yellow
Label8.Visible = True
Label6.Visible = False
Label7.Visible = False
If LogInCheckBox1.Checked = True Then 'Anti dc id
emad = New agsXMPP.XmppClientConnection
With emad
.Server = "nimbuzz.com"
.ConnectServer = "o.nimbuzz.com"
.Open(LogInUserTextBox1.Text, LogInUserTextBox2.Text) 'id + password
.Resource = ("Nimbuzz_Symbian" & Me.Generatecode())
.Status = ("TEST")
.ClientVersion = ("1.0")
.Port = "5222"
AddHandler .OnClose, AddressOf dc
AddHandler .OnReadXml, AddressOf Xml4
AddHandler .OnLogin, AddressOf loged
AddHandler .OnAuthError, AddressOf wrong
End With
End If
End If
End Sub
Private Sub loged(ByVal sender As Object)
If MyBase.InvokeRequired = True Then
MyBase.BeginInvoke(New agsXMPP.ObjectHandler(AddressOf loged), New Object() {sender})
Else
'loged Contact id
LogInUserTextBox1.BackColor = Color.LimeGreen
LogInUserTextBox2.BackColor = Color.LimeGreen
Label6.Visible = True
Label7.Visible = False
Label8.Visible = False
End If
End Sub
Private Sub wrong(ByVal sender As Object, ByVal e As agsXMPP.Xml.Dom.Element)
If MyBase.InvokeRequired = True Then
MyBase.BeginInvoke(New agsXMPP.XmppElementHandler(AddressOf wrong), New Object() {sender, e})
Else
'wrong Contact id
LogInUserTextBox1.BackColor = Color.Red
LogInUserTextBox2.BackColor = Color.Red
Label7.Visible = True
Label6.Visible = False
Label8.Visible = False
End If
End Sub
Public Function Generatecode() As Object
Dim intRnd As Object
Dim strName As Object
Dim intNameLength As Object
Dim intLenght As Object
Dim strInputString As Object
Dim inStep As Object
strInputString = "1234567890"
intLenght = Len(strInputString)
intNameLength = 3
Randomize()
strName = ""
For inStep = 1 To intNameLength
intRnd = Int((intLenght * Rnd()) + 1)
strName = strName & Mid(strInputString, intRnd, 1)
Next
Generatecode = strName
End Function
Private Sub LogInButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton4.Click
emad.Send("<presence to='" + room.Text + "@conference.nimbuzz.com/" + LogInUserTextBox1.Text + "'><x xmlns='http://jabber.org/protocol/muc'></x></presence>")
Timer1.Enabled = True
End Sub
Private Sub LogInButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton2.Click
emad.Close()
End Sub
Private Sub LogInButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton3.Click
emad.Send("<presence to='" + room.Text + "@conference.nimbuzz.com/imanking' type='unavailable'></presence>") 'left room
Timer1.Enabled = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim i As Integer = 1
i = Convert.ToInt32("1000")
Me.Timer1.Interval = (i * 1000)
emad.Send(("<message from='" + room.Text + "@conference.nimbuzz.com/" + LogInUserTextBox1.Text + "' id='aaf1a' type='groupchat'><body> ✔ hide msg :D</body><html xmlns='http://jabber.org/protocol/xhtml-im'><body xmlns='http://www.w3.org/1999/xhtml'><p><em>false</em><strong>true</strong><span style='#ffff441e'/></p></body></html></message> "))
End Sub
Private Sub LogInButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton5.Click
If (MessageBox.Show((Me.us.Text & " kick you?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<iq to='", room.Text, "@conference.nimbuzz.com' type='set' id='itemmuc'><query xmlns='http://jabber.org/protocol/muc#admin'><item role='none' nick='", Me.us.Text, "'><reason>kicked</reason></item></query></iq>"}))
Label12.Text = (Me.us.Text & " ↦ " & " kicked")
End If
End Sub
Private Sub LogInButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton6.Click
If (MessageBox.Show((Me.us.Text & " Ban you?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<iq id=""o3d*"" to=""", room.Text, "@conference.nimbuzz.com"" type=""set""><query xmlns=""http://jabber.org/protocol/muc#admin""><item affiliation=""outcast"" jid=""", Me.us.Text, "@nimbuzz.com""/></query></iq>"}))
Label12.Text = (Me.us.Text & " Bannd")
End If
End Sub
Private Sub LogInButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton7.Click
If (MessageBox.Show((Me.us.Text & " member you?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<iq id=""o3d*"" to=""", room.Text, "@conference.nimbuzz.com"" type=""set""><query xmlns=""http://jabber.org/protocol/muc#admin""><item affiliation=""member"" jid=""", Me.us.Text, "@nimbuzz.com""/></query></iq>"}))
Label12.Text = (Me.us.Text & " ↦ " & " member")
End If
End Sub
Private Sub LogInButton10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton10.Click
If (MessageBox.Show((" Kick all room?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<message to='", room.Text, "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>/kick a</body></message>"}))
Label12.Text = ("Kicked all room")
End If
End Sub
Private Sub LogInButton9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton9.Click
If (MessageBox.Show((" Ban all room?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<message to='", room.Text, "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>/ban a</body></message>"}))
Label12.Text = ("Bannd all room")
End If
End Sub
Private Sub LogInButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton8.Click
If (MessageBox.Show(("Member all room?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<message to='", room.Text, "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>/mem a</body></message>"}))
Label12.Text = ("Member all room")
End If
End Sub
Private Sub LogInButton16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton16.Click
If (MessageBox.Show((Me.us.Text & " Visitor you?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<iq to='", room.Text, "@conference.nimbuzz.com' type='set' id='itemmuc'><query xmlns='http://jabber.org/protocol/muc#admin'><item role='visitor' nick='", Me.us.Text, "'/></query></iq>"}))
Label12.Text = (Me.us.Text & "visitor")
End If
End Sub
Private Sub LogInButton15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton15.Click
If (MessageBox.Show((Me.us.Text & " Make Owner?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<iq id=""o3d*"" to=""", room.Text, "@conference.nimbuzz.com"" type=""set""><query xmlns=""http://jabber.org/protocol/muc#admin""><item affiliation=""owner"" jid=""", Me.us.Text, "@nimbuzz.com""/></query></iq>"}))
Label12.Text = (Me.us.Text & " ↦ " & "Owner")
End If
End Sub
Private Sub LogInButton14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton14.Click
If (MessageBox.Show((Me.us.Text & "none you?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<iq to='", room.Text, "@conference.nimbuzz.com' type='set' id='admin_modify'><query xmlns='http://jabber.org/protocol/muc#admin'><item jid='", Me.us.Text, "@nimbuzz.com' affiliation='none'/></query></iq> "}))
Label12.Text = (Me.us.Text & "None")
End If
End Sub
Private Sub LogInButton13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton13.Click
If (MessageBox.Show((Me.us.Text & "Unvisitor you?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<iq to='", room.Text, "@conference.nimbuzz.com' type='set' id='itemmuc'><query xmlns='http://jabber.org/protocol/muc#admin'><item role='participant' nick='", us.Text, "'/></query></iq>"}))
Label12.Text = (Me.us.Text & " ↦ " & "Unvisitor")
End If
End Sub
Private Sub LogInButton12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton12.Click
If (MessageBox.Show((Me.us.Text & " Make Admin?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<iq id=""o3d*"" to=""", room.Text, "@conference.nimbuzz.com"" type=""set""><query xmlns=""http://jabber.org/protocol/muc#admin""><item affiliation=""admin"" jid=""", Me.us.Text, "@nimbuzz.com""/></query></iq>"}))
Label12.Text = (Me.us.Text & " ↦ " & "Admin")
End If
End Sub
Private Sub LogInButton11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton11.Click
If (MessageBox.Show((Me.us.Text & " Band ip?"), "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) = DialogResult.Yes) Then
emad.Send(String.Concat(New String() {"<message to='", room.Text, "@conference.nimbuzz.com' type='groupchat' id='macoud'><body>/ban f ", us.Text, "</body></message>"}))
Label12.Text = (Me.us.Text & " ↦ " & "Bannd ip")
End If
End Sub
Private Sub ListBox1_MouseDoubleClick(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim itemIndex As Integer = Me.ListBox1.IndexFromPoint(e.Location)
If itemIndex <> System.Windows.Forms.ListBox.NoMatches Then
us.Text = ""
us.Text = ListBox1.Items(itemIndex)
End If
End Sub
Private Sub LogInButton17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton17.Click
Try
emad.Send("<message to='" + room.Text + "@conference.nimbuzz.com' type='groupchat'><body>" + LogInUserTextBox7.Text + "</body></message>")
LogInUserTextBox7.Text = ""
Catch ex As Exception
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
LogInUserTextBox7.Text &= ":-SS" & sender.text
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
LogInUserTextBox7.Text &= "(a)" & sender.text
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
LogInUserTextBox7.Text &= ":@" & sender.text
End Sub
Private Sub Button22_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button22.Click
LogInUserTextBox7.Text &= "" & sender.text
End Sub
Private Sub ListBox2_MouseDoubleClick(ByVal sender As Object, ByVal e As MouseEventArgs) Handles ListBox2.MouseDoubleClick
Dim itemIndex As Integer = Me.ListBox2.IndexFromPoint(e.Location)
If itemIndex <> System.Windows.Forms.ListBox.NoMatches Then
LogInUserTextBox8.Text = ""
LogInUserTextBox8.Text = ListBox2.Items(itemIndex)
End If
End Sub
Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
End Sub
Private Sub LogInButton18_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton18.Click
emad.Send(("<iq type='get' to='" & Me.room.Text & "@conference.nimbuzz.com' id='qip_1026'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='outcast' /></query></iq>"))
End Sub
Private Sub LogInButton19_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton19.Click
Dim close As String
close = MessageBox.Show("Do you want to give this user member or none" & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "yes = member" & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "No = none " & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "هل تريد اعطاء هذا المستخدم عضوية" & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "اذا اخترت yes يعطي عضوية" & ChrW(13) & ChrW(10) & ChrW(13) & ChrW(10) & "اذا اخترت no يعطي بلا عضوية", "{Information}", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2)
If close = MsgBoxResult.No Then
emad.Send(String.Concat(New String() {"<iq to='", room.Text, "@conference.nimbuzz.com' type='set' id='admin_modify'><query xmlns='http://jabber.org/protocol/muc#admin'><item jid='", Me.LogInUserTextBox8.Text, "' affiliation='none'/></query></iq> "}))
NotifyIcon1.ShowBalloonTip(5000, "Doctor room nimbuzz V.1", "Now none" & "↦" & LogInUserTextBox8.Text, ToolTipIcon.Info)
Else
emad.Send(String.Concat(New String() {"<iq id=""o3d*"" to=""", room.Text, "@conference.nimbuzz.com"" type=""set""><query xmlns=""http://jabber.org/protocol/muc#admin""><item affiliation=""member"" jid=""", Me.LogInUserTextBox8.Text, """/></query></iq>"}))
NotifyIcon1.ShowBalloonTip(5000, "Doctor room nimbuzz V.1", "Now member" & "↦" & LogInUserTextBox8.Text, ToolTipIcon.Info)
End If
End Sub
Private Sub LogInButton20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInButton20.Click
emad.Send(("<iq type='get' to='" & Me.room.Text & "@conference.nimbuzz.com' id='qip_1026'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='member' /></query></iq>"))
End Sub
Private Sub LogInCheckBox2_CheckedChanged(ByVal sender As System.Object) Handles LogInCheckBox2.CheckedChanged
If LogInCheckBox2.Checked = True Then
Timer1.Enabled = True
Else
Timer1.Enabled = False
End If
End Sub
Private Sub ListBox3_MouseDoubleClick(ByVal sender As Object, ByVal e As MouseEventArgs) Handles ListBox3.MouseDoubleClick
Dim itemIndex As Integer = Me.ListBox3.IndexFromPoint(e.Location)
If itemIndex <> System.Windows.Forms.ListBox.NoMatches Then
LogInUserTextBox9.Text = ""
LogInUserTextBox9.Text = ListBox3.Items(itemIndex)
End If
End Sub
Private Function SplitXML(ByVal FirstInt As String, ByVal LastInt As String, ByVal SplitFromXML As String) As String
Dim num As Integer = Strings.InStr(1, SplitFromXML, FirstInt, CompareMethod.Binary)
If (num > 0) Then
Dim num2 As Integer = Strings.InStr((num + Strings.Len(FirstInt)), SplitFromXML, LastInt, CompareMethod.Binary)
If (num2 > 0) Then
Dim length As Integer = (num2 - (num + Strings.Len(FirstInt)))
Return Strings.Mid(SplitFromXML, (num + Strings.Len(FirstInt)), length)
End If
Return ""
End If
Return ""
End Function
Private Sub Xml7(ByVal sender As Object, ByVal a As String)
If MyBase.InvokeRequired Then
MyBase.BeginInvoke(New XmlHandler(AddressOf Me.Xml7), New Object() {RuntimeHelpers.GetObjectValue(sender), a})
Else
a = Strings.Replace(a, """", "'", 1, -1, CompareMethod.Binary)
Me.a1 = a
If (Strings.InStr(a, "<item role='moderator'", CompareMethod.Binary) > 0) Then
End If
If (Strings.InStr(a, "<item role='participant'", CompareMethod.Binary) > 0) Then
End If
If (Strings.InStr(Me.a1, " type='unavailable'", CompareMethod.Binary) > 0) Then
End If
If (Strings.InStr(Me.a1, "' affiliation='outcast'", CompareMethod.Text) <> 0) Then
Dim str11 As String = Me.SplitXML("' nick='", "'>", Me.a1)
Dim text As String = Me.SplitXML("<actor jid='", "@nimbuzz.com' nick='", Me.a1)
RichTextBox1.SelectionColor = Color.Gold
RichTextBox1.AppendText(("[" & Conversions.ToString(DateAndTime.TimeOfDay) & "] "))
RichTextBox1.SelectionColor = Color.Green
RichTextBox1.AppendText((str11 & " Ban By: "))
RichTextBox1.SelectionColor = Color.Orange
RichTextBox1.AppendText([text])
RichTextBox1.AppendText(ChrW(13) & ChrW(10))
RichTextBox1.SelectionStart = RichTextBox1.Text.Length
RichTextBox1.ScrollToCaret()
End If
If (Strings.InStr(Me.a1, "' role='none'", CompareMethod.Text) <> 0) Then
Dim str13 As String = Me.SplitXML("' nick='", "'>", Me.a1)
Dim str12 As String = Me.SplitXML("<actor jid='", "@nimbuzz.com' nick='", Me.a1)
RichTextBox1.SelectionColor = Color.Gold
RichTextBox1.AppendText(("[" & Conversions.ToString(DateAndTime.TimeOfDay) & "] "))
RichTextBox1.SelectionColor = Color.Green
RichTextBox1.AppendText((str13 & " Kick By: "))
RichTextBox1.SelectionColor = Color.Orange
RichTextBox1.AppendText(str12)
RichTextBox1.AppendText(ChrW(13) & ChrW(10))
RichTextBox1.SelectionStart = RichTextBox1.Text.Length
RichTextBox1.ScrollToCaret()
End If
If (Strings.InStr(Me.a1, "<actor nick='", CompareMethod.Text) <> 0) Then
Dim str14 As String = Me.SplitXML("' nick='", "'>", Me.a1)
RichTextBox1.SelectionColor = Color.Gold
RichTextBox1.AppendText(("[" & Conversions.ToString(DateAndTime.TimeOfDay) & "] "))
RichTextBox1.SelectionColor = Color.Green
RichTextBox1.AppendText((str14 & " Kick By: "))
RichTextBox1.SelectionColor = Color.Orange
RichTextBox1.AppendText(room.Text)
RichTextBox1.AppendText(ChrW(13) & ChrW(10))
RichTextBox1.SelectionStart = RichTextBox1.Text.Length
RichTextBox1.ScrollToCaret()
End If
If (Strings.InStr(a, "</last></set></query></iq>", CompareMethod.Binary) > 0) Then
End If
End If
End Sub
Private Sub LogInOnOffSwitch5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInOnOffSwitch5.Click
If Me.LogInOnOffSwitch5.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='setform'><query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'><field var='muc#roomconfig_roomname' type='text-single'><value>", Me.room.Text, "</value></field><field var='muc#roomconfig_roomdesc' type='text-single'><value></value></field><field var='muc#roomconfig_persistentroom' type='boolean'><value>1</value></field><field var='muc#roomconfig_passwordprotectedroom' type='boolean'><value>0</value></field><field var='muc#roomconfig_roomsecret' type='text-single'><value></value></field><field var='muc#roomconfig_lang' type='text-single'><value></value></field><field var='muc#roomconfig_location' type='text-single'><value></value></field><field var='muc#roomconfig_location-type' type='list-single'><value>worldwide</value></field><field var='muc#roomconfig_membersonly' type='boolean'><value>1</value></field><field var='muc#roomconfig_pnvonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_maxusers' type='list-single'><value>25</value></field></x></query></iq> "}))
MsgBox(("" & Me.room.Text & " Member only Start 【✔】"))
Else
Me.LogInOnOffSwitch5.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.NotToggled
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='setform'><query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'><field var='muc#roomconfig_roomname' type='text-single'><value>", Me.room.Text, "</value></field><field var='muc#roomconfig_roomdesc' type='text-single'><value></value></field><field var='muc#roomconfig_persistentroom' type='boolean'><value>1</value></field><field var='muc#roomconfig_passwordprotectedroom' type='boolean'><value>0</value></field><field var='muc#roomconfig_roomsecret' type='text-single'><value></value></field><field var='muc#roomconfig_lang' type='text-single'><value></value></field><field var='muc#roomconfig_location' type='text-single'><value></value></field><field var='muc#roomconfig_location-type' type='list-single'><value>worldwide</value></field><field var='muc#roomconfig_membersonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_pnvonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_maxusers' type='list-single'><value>25</value></field></x></query></iq> "}))
MsgBox(("" & Me.room.Text & " Member only Stoped【✘】"))
End If
End Sub
Private Sub LogInOnOffSwitch6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInOnOffSwitch6.Click
If Me.LogInOnOffSwitch6.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='setform'><query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'><field var='muc#roomconfig_roomname' type='text-single'><value>", Me.room.Text, "</value></field><field var='muc#roomconfig_roomdesc' type='text-single'><value></value></field><field var='muc#roomconfig_persistentroom' type='boolean'><value>1</value></field><field var='muc#roomconfig_passwordprotectedroom' type='boolean'><value>0</value></field><field var='muc#roomconfig_roomsecret' type='text-single'><value></value></field><field var='muc#roomconfig_lang' type='text-single'><value></value></field><field var='muc#roomconfig_location' type='text-single'><value></value></field><field var='muc#roomconfig_location-type' type='list-single'><value>worldwide</value></field><field var='muc#roomconfig_membersonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_pnvonly' type='boolean'><value>1</value></field><field var='muc#roomconfig_maxusers' type='list-single'><value>25</value></field></x></query></iq>"}))
MsgBox(("" & Me.room.Text & " Check mobile number Success【✔】"))
Else
Me.LogInOnOffSwitch6.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.NotToggled
emad.Send(String.Concat(New String() {"<iq to='", Me.room.Text, "@conference.nimbuzz.com' type='set' id='setform'><query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'><field var='muc#roomconfig_roomname' type='text-single'><value>", Me.room.Text, "</value></field><field var='muc#roomconfig_roomdesc' type='text-single'><value></value></field><field var='muc#roomconfig_persistentroom' type='boolean'><value>1</value></field><field var='muc#roomconfig_passwordprotectedroom' type='boolean'><value>0</value></field><field var='muc#roomconfig_roomsecret' type='text-single'><value></value></field><field var='muc#roomconfig_lang' type='text-single'><value></value></field><field var='muc#roomconfig_location' type='text-single'><value></value></field><field var='muc#roomconfig_location-type' type='list-single'><value>worldwide</value></field><field var='muc#roomconfig_membersonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_pnvonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_maxusers' type='list-single'><value>25</value></field></x></query></iq>"}))
MsgBox(("" & Me.room.Text & " Check mobile number Failure【✘】"))
End If
End Sub
Private Sub LogInRadioButton1_CheckedChanged(ByVal sender As System.Object) Handles LogInRadioButton1.CheckedChanged
emad.Send("<iq to='" + room.Text + "@conference.nimbuzz.com' type='set' id='setform'><query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'><field var='muc#roomconfig_roomname' type='text-single'><value>" + room.Text + "</value></field><field var='muc#roomconfig_roomdesc' type='text-single'><value></value></field><field var='muc#roomconfig_persistentroom' type='boolean'><value>1</value></field><field var='muc#roomconfig_passwordprotectedroom' type='boolean'><value>0</value></field><field var='muc#roomconfig_roomsecret' type='text-single'><value></value></field><field var='muc#roomconfig_lang' type='text-single'><value>ar</value></field><field var='muc#roomconfig_location' type='text-single'><value></value></field><field var='muc#roomconfig_location-type' type='list-single'><value>worldwide</value></field><field var='muc#roomconfig_membersonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_pnvonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_maxusers' type='list-single'><value>25</value></field></x></query></iq>")
End Sub
Private Sub LogInRadioButton2_CheckedChanged(ByVal sender As System.Object) Handles LogInRadioButton2.CheckedChanged
emad.Send("<iq to='" + room.Text + "@conference.nimbuzz.com' type='set' id='setform'><query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'><field var='muc#roomconfig_roomname' type='text-single'><value>" + room.Text + "</value></field><field var='muc#roomconfig_roomdesc' type='text-single'><value></value></field><field var='muc#roomconfig_persistentroom' type='boolean'><value>1</value></field><field var='muc#roomconfig_passwordprotectedroom' type='boolean'><value>0</value></field><field var='muc#roomconfig_roomsecret' type='text-single'><value></value></field><field var='muc#roomconfig_lang' type='text-single'><value>en</value></field><field var='muc#roomconfig_location' type='text-single'><value></value></field><field var='muc#roomconfig_location-type' type='list-single'><value>worldwide</value></field><field var='muc#roomconfig_membersonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_pnvonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_maxusers' type='list-single'><value>25</value></field></x></query></iq>")
End Sub
Private Sub LogInOnOffSwitch9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LogInOnOffSwitch9.Click
If Me.LogInOnOffSwitch9.Toggled = Doctor_room_nimbuzz_V._1.LogInOnOffSwitch.Toggles.Toggled Then
emad.Send("<iq to='" + room.Text + "@conference.nimbuzz.com' type='set' id='setform'><query xmlns='http://jabber.org/protocol/muc#owner'><x xmlns='jabber:x:data' type='submit'><field var='muc#roomconfig_roomname' type='text-single'><value>" + room.Text + "</value></field><field var='muc#roomconfig_roomdesc' type='text-single'><value></value></field><field var='muc#roomconfig_persistentroom' type='boolean'><value>1</value></field><field var='muc#roomconfig_passwordprotectedroom' type='boolean'><value>0</value></field><field var='muc#roomconfig_roomsecret' type='text-single'><value></value></field><field var='muc#roomconfig_lang' type='text-single'><value>ar</value></field><field var='muc#roomconfig_location' type='text-single'><value></value></field><field var='muc#roomconfig_location-type' type='list-single'><value>worldwide</value></field><field var='muc#roomconfig_membersonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_pnvonly' type='boolean'><value>0</value></field><field var='muc#roomconfig_maxusers' type='list-single'><value>25</value></field></x></query></iq>")
MsgBox(("" & Me.room.Text & " The room has become in search of all the world【✔】"))
End If
End Sub
End Class