منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : مساعدة في تعامل مع xor
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم ورحمة الله وبركاته



0B3D9589FD15AC05 Xor 030EB87EDF3F249D

كيف يمكن استخراج  هذا الناتج

يساوي 08332DF7222A8898


السلام عليكم اخي الكريم
لم اجد طريقة انقل لك كبف هي ال XOR الا هذا الكود

نفذ هذا الكود علك تفهم عملها


كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       '(A and not B) or (not A and B)
       Dim A As Integer = 10
       Dim B As Integer = 4
       Dim result As Integer = A Xor B
       MsgBox(result)

       '========================
       '(A and B) or (not A and not B)
       Dim AA As Boolean
       Dim BB As Boolean
       '=======
       AA = True
       BB = True
       Dim result1 As Boolean = AA Xor BB
       MsgBox(result1)

       AA = False
       BB = True
       Dim result2 As Boolean = AA Xor BB
       MsgBox(result2)

       AA = True
       BB = False
       Dim result3 As Boolean = AA Xor BB
       MsgBox(result3)

       AA = False
       BB = False
       Dim result4 As Boolean = AA Xor BB
       MsgBox(result4)

   End Sub
(05-08-19, 11:58 PM)ابراهيم ايبو كتب : [ -> ]
السلام عليكم اخي الكريم
لم اجد طريقة انقل لك كبف هي ال XOR الا هذا الكود

نفذ هذا الكود علك تفهم عملها


كود :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       '(A and not B) or (not A and B)
       Dim A As Integer = 10
       Dim B As Integer = 4
       Dim result As Integer = A Xor B
       MsgBox(result)

       '========================
       '(A and B) or (not A and not B)
       Dim AA As Boolean
       Dim BB As Boolean
       '=======
       AA = True
       BB = True
       Dim result1 As Boolean = AA Xor BB
       MsgBox(result1)

       AA = False
       BB = True
       Dim result2 As Boolean = AA Xor BB
       MsgBox(result2)

       AA = True
       BB = False
       Dim result3 As Boolean = AA Xor BB
       MsgBox(result3)

       AA = False
       BB = False
       Dim result4 As Boolean = AA Xor BB
       MsgBox(result4)

   End Sub
شكرا لك اخي ابراهيم على الرد انا اعلم هذه الطريقة

ولكن لاحض القيمة المقترحة في الموضوع وهي قيمة بالهيكس 0B3D9589FD15AC05 Xor 030EB87EDF3F249D
اخي الكريم 
والله اعلم ان ارقامك فيها خطأ (رغم اني لااجيد قراءة هذه الارقام)
بعد تغيير بسيط  في ارقامك اليك الاكواد
كود :
Dim Value1 As Integer = &HF8F
       Dim Value2 As Integer = &HFB8E
       Dim result5 As Integer = Value1 Xor Value2
       MsgBox(result5)

       Dim Value3 As Decimal = &HB3D9589FD15AC05
       Dim Value4 As Decimal = &H30EB87EDF3F249D
       Dim result6 As Decimal = Value3 Xor Value4
       MsgBox(result6)