26-02-18, 03:58 PM
سلام عليكم
الخلل في الكود ادناه والمشكلة تكمن في
ان ProgressBar
يظهر عمله لمرة واحدة فقط
PHP كود :
Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork
Dim i As Integer
For i = 0 To ListBox1.Items.Count - 1
Me.emad1.Send(String.Concat(New String() {"<iq from='", Me.emad1.Username.ToString, "@nimbuzz.com/", Me.emad1.Resource, "' type='set' to='uprofile.nimbuzz.com' id='pcClient-299'><profile xmlns='http://jabber.org/protocol/profile'><x xmlns='jabber:x:data' type='submit'><field type='hidden' var='FORM_TYPE'><value>http://jabber.org/protocol/profile</value></field><field var='nickname'><value>", Me.TextBox3.Text, "</value></field></x></profile></iq>"}))
Me.emad1.Send(String.Concat(New String() {"<presence to='" & ListBox1.Items(i) & "@s.chatp.net' type='subscribe'/>"}))
Me.emad1.Send(String.Concat(New String() {"<message type='chat' id='purple8c986e43' to='" & ListBox1.Items(i) & "@s.chatp.net'><active xmlns='http://jabber.org/protocol/chatstates'/><body>" + Form2.TextBox1.Text + "</body></message>"}))
Me.emad1.Send(String.Concat(New String() {"<message type='chat' id='purple8c986e43' to='" & ListBox1.Items(i) & "@s.chatp.net'><active xmlns='http://jabber.org/protocol/chatstates'/><body>" + Form2.TextBox2.Text + "</body></message>"}))
Me.emad1.Send(String.Concat(New String() {"<message type='chat' id='purple8c986e43' to='" & ListBox1.Items(i) & "@s.chatp.net'><active xmlns='http://jabber.org/protocol/chatstates'/><body>" + Form2.TextBox3.Text + "</body></message>"}))
Me.emad1.Send(String.Concat(New String() {"<message type='chat' id='purple8c986e43' to='" & ListBox1.Items(i) & "@s.chatp.net'><active xmlns='http://jabber.org/protocol/chatstates'/><body>" + Form2.TextBox4.Text + "</body></message>"}))
Threading.Thread.Sleep(1000)
Dim a As Integer = (i)
Dim b As Integer = (ListBox1.Items.Count)
Me.ProgressBar1.Invoke(Sub()
Me.ProgressBar1.Value = ((a + 1) / (b)) * 100
End Sub)
Label14.Text = (ListBox1.Items(i))
Next
Me.id1.Clear()
End Sub