الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

Hw To Stop Loop

بدأه Saatchi في 20 مارس 2009 · 2 رد · 621 مشاهدة · في Microsoft Visual Basic.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

salam all

the user can tries 3 times in each time when the password is wrong the msgbox tells the user ur password is wrong

the 3 times the message said u r hackers.

could u plz help me with my code

Dim logincount As Integer

Dim counter As Integer

For counter = 1 To 3

logincount = logincount + 1

If logincount = 3 Then

MsgBox("no more tries")

Exit Sub

End If

If txtpassword.Text = "password" Then

MsgBox("right")

Else

MsgBox("incorrect")

End If

Next

إذا كنت قد استطعت رؤية ما هو أبعد من أن يراه الاخرون ، فذلك لأنني وقفت على أكتاف عمالقة سبقوني .

#2

Hi Brother,

 


Dim Logged [color= #b1b100;]As Boolean [color= #339933;]= [color= #000000; font-weight: bold;]False

Dim TCount [color= #b1b100;]As Integer [color= #339933;]= [color= #cc66cc;]1

[color= #b1b100;]Do Until Logged

Dim _Password [color= #339933;]= InputBox[color= #009900;]( [color= #0000ff;]"Please type your password" [color= #009900;])

[color= #b1b100;]If Not _Password Is Nothing Then [color= #b1b100;]If _Password [color= #339933;]= [color= #0000ff;]"password" Then Logged [color= #339933;]= [color= #000000; font-weight: bold;]True [color= #b1b100;]Else TCount [color= #339933;]+= [color= #cc66cc;]1

[color= #b1b100;]If TCount [color= #339933;]> [color= #cc66cc;]2 Then MsgBox[color= #009900;]( [color= #0000ff;]"Sorry sir, You have tried more than two times ." [color= #009900;]) [color= #339933;]: [color= #990000;]Exit [color= #b1b100;]Do

Loop

[color= #b1b100;]If Not Logged Then [color= #990000;]End

I have problems with the AR language :(,

Good luck,

The important thing is not so much

that every child should be taught,

as that every child should be given the wish to learn.

#3

Dim logincount As Integer

Dim counter As Integer

For counter = 1 To 3

logincount = logincount + 1

If logincount = 3 Then

MsgBox("no more tries")

exit for ///just this

Exit Sub

End If

If txtpassword.Text = "password" Then

MsgBox("right")

exit for ///just this

Else

MsgBox("incorrect")

End If

Next

مواضيع مشابهة