التنبيهات التالية ظهرت :
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 864 errorHandler->error



تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
مشكلة في تحويل كود من c# الى vb.net
#1
السلام عليكم , قمت بتحويل برنامج من c# الى vb.net ولكن واجهت مشكلة في أحد الاسطر أتمنى منكم مساعدتي في حلها وشكراً


هذا النص الاصلي

كود :
       private void Prec(object sender, Presence p)
       {
           {
               {
                   if (InvokeRequired)
                       BeginInvoke(new agsXMPP.protocol.client.PresenceHandler(Prec), new object[] { sender, p });
                   else
                   {
                       if (checkBox2.Checked == true)
                       {
                           if (p.Type == agsXMPP.protocol.client.PresenceType.subscribe)
                           {

                               x.Send("<presence to=\"" + p.From + "\" type=\"subscribed\" />" +
                                   "<presence to=\"" + p.From + "\" type=\"subscribe\" />");
                               x.Send("<message to=\"" + p.From + "\" type=\"chat\"><body>" + textBox5.Text + "</body></message>");
                           }
                       }
                   }
               }
           }
       }
           void cnt_OnMessage1(object sender, agsXMPP.protocol.client.Message Msg)
       {
           if (InvokeRequired)
               BeginInvoke(new agsXMPP.protocol.client.MessageHandler(cnt_OnMessage1), new object[] { sender, Msg });
           else
           {
               if (Msg.Body.ToLower().StartsWith(textBox6.Text))
               {
                   x.Send("<message to=\"" + Msg.From + "\" type=\"chat\"><body> You Are Member </body></message>");
                   x.Send("<iq to='" + textBox4.Text + "@conference.nimbuzz.com' type='set' id='ChatBuzz'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='member' jid='" + Msg.From.Resource + "@nimbuzz.com'/></query></iq>");
                   x.Send("<message id='mir_141' to='" + textBox4.Text + "@conference.nimbuzz.com' type='groupchat'><body>" + Msg.From.Resource + "  You Are Member</body></message>");
               }
           }
       }


هذا الكود لدي بعد تحويله الى vb



كود :
Class SurroundingClass
   Private Sub Prec(ByVal sender As Object, ByVal p As Presence)
       If True Then

           If True Then

               If InvokeRequired Then
                   BeginInvoke(New agsXMPP.protocol.client.PresenceHandler(AddressOf Prec), New Object() {sender, p})
               Else

                   If checkBox2.Checked = True Then

                       If p.Type = agsXMPP.protocol.client.PresenceType.subscribe Then
                           x.Send("<presence to=""" & p.From & """ type=""subscribed"" />" & "<presence to=""" + p.From & """ type=""subscribe"" />")
                           x.Send("<message to=""" & p.From & """ type=""chat""><body>" + textBox5.Text & "</body></message>")
                       End If
                   End If
               End If
           End If
       End If
   End Sub

   Private Sub cnt_OnMessage1(ByVal sender As Object, ByVal Msg As agsXMPP.protocol.client.Message)
       If InvokeRequired Then
           BeginInvoke(New agsXMPP.protocol.client.MessageHandler(AddressOf cnt_OnMessage1), New Object() {sender, Msg})
       Else

           If Msg.Body.ToLower().StartsWith(textBox6.Text) Then
               x.Send("<message to=""" & Msg.From & """ type=""chat""><body> You Are Member </body></message>")
               x.Send("<iq to='" & textBox4.Text & "@conference.nimbuzz.com' type='set' id='ChatBuzz'><query xmlns='http://jabber.org/protocol/muc#admin'><item affiliation='member' jid='" + Msg.From.Resource & "@nimbuzz.com'/></query></iq>")
               x.Send("<message id='mir_141' to='" & textBox4.Text & "@conference.nimbuzz.com' type='groupchat'><body>" + Msg.From.Resource & "  You Are Member</body></message>")
           End If
       End If
   End Sub
End Class


وهذا رابط المشروع كامل 
الْحَمْدُ لِلَّهِ حَمْدًا كَثِيرًا طَيِّبًا مُبَارَكًا فِيهِ

رَبِّي أَرْزُقْنِي مُسْتَقْبَلاً أَجَمَلَ مِمَّا تَمَنَّيْتُ

وَاَجْعَل لِي فِيْ هَذِهِ الدُّنْيَا - أُنَاساً يَدْعُونَ لِي بَعْدَ أَنْ أَغِيْب

حسابي في تلكرام

الرد }}}
تم الشكر بواسطة: bidaya , ابو روضة , ابو روضة , ابراهيم ايبو


الردود في هذا الموضوع
مشكلة في تحويل كود من c# الى vb.net - بواسطة aldery - 17-05-21, 12:27 AM


التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم