اطلاعیه

Collapse
No announcement yet.

قفل رمز

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    #16
    پاسخ : قفل رمز

    دوست عزیز
    بهتر بود خودتم با این راهنمایی هایی که شد یک تلاش می کردی

    نه اینکه صبر کنی دیگران همه چی رو آماده کنن

    اینطوری خودتون ورزیده تر میشید و به تجربیاتتون اضافه تر میشه

    دیدگاه


      #17
      پاسخ : قفل رمز

      نوشته اصلی توسط V.TESLA
      با درود . . .
      میتونید از این برنامه استفاده کنید. . .
      ببخشید که نمیتونم الان توضیح بدم آخه فردا امتحان دارم بعد از اینکه اومدم توضیحش رو میزارم رو سایت


      $regfile = "m16def.dat"
      $crystal = 8000000
      Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = _
      Portb.7 , E = Portb.3 , Rs = Portb.2
      Config Lcd = 16 * 2
      Config Kbd = Portd , Debounce = 100 , Delay = 75
      Ddrc.0 = 1 : Portc.0 = 0

      Dim A1 As Eram Byte , B1 As Eram Byte , C1 As Eram Byte , D1 As Eram Byte
      Dim A2 As Byte , B2 As Byte , C2 As Byte , D2 As Byte
      Dim Key As Byte
      Dim Mem As Byte
      Dim Count As Byte
      Declare Sub Kelid
      Declare Sub Coder

      Cursor Off
      If A1 > 10 And B1 > 10 And C1 > 10 And D1 > 10 Then
      A1 = 0 : B1 = 0 : C1 = 0 : D1 = 0 : End If

      Main:
      Cls : Count = 0
      A2 = 25 : B2 = 25 : C2 = 25 : D2 = 25
      Do
      Call Kelid
      Call Coder
      Key = Getkbd()
      Locate 1 , 2
      Lcd "enter password"
      If A2 = A1 And B2 = B1 And C2 = C1 And D2 = D1 And Key = 15 Then
      Cls
      Locate 1 , 1
      Lcd "password correct"
      Wait 1
      '****************************your main write here*****************************
      Set Portc.0
      Waitms 500
      Reset Portc.0
      Count = 0 : Cls
      jmp main
      '*******************************end your main*********************************
      End If
      '*****************************change password*******************************
      If Key = 3 Then
      Cls : Home
      Lcd "change password"
      Wait 1
      Vahid1:
      Cls
      Count = 0
      A2 = 25 : B2 = 25 : C2 = 25 : D2 = 25
      Cls : Do
      If Key = 7 Then
      jmp main:end IF
      Call Kelid
      Call Coder
      Locate 1 , 2
      Lcd "enter password"
      If A2 = A1 And B2 = B1 And C2 = C1 And D2 = D1 And Key = 15 Then
      Cls
      Vahid2:
      Cls
      Count = 0
      A2 = 25 : B2 = 25 : C2 = 25 : D2 = 25
      Vahid:
      Call Kelid
      Call Coder
      If Key = 7 Then
      jmp main:end IF
      Locate 1 , 3
      Lcd "new password"
      If Key = 15 And Count = 4 Then
      A1 = A2 : B1 = B2 : C1 = C2 : D1 = D2 : Jmp Main
      End If
      jmp vahid
      End If
      If Key = 15 Then
      jmp vahid1: end if
      Loop
      End If
      If Key = 15 Then
      jmp main:end if
      If Key = 7 Then
      jmp main:end IF
      Loop
      End

      Kelid:
      Key = Getkbd()
      Select Case Key
      Case 0
      Mem = 1 : Incr Count
      Case 1 :
      Mem = 2 : Incr Count
      Case 2 :
      Mem = 3 : Incr Count
      Case 4 :
      Mem = 4 : Incr Count
      Case 5 :
      Mem = 5 : Incr Count
      Case 6 :
      Mem = 6 : Incr Count
      Case 8 :
      Mem = 7 : Incr Count
      Case 9 :
      Mem = 8 : Incr Count
      Case 10 :
      Mem = 9 : Incr Count
      Case 13 :
      Mem = 0 : Incr Count
      End Select
      Return

      Coder:
      If Count = 1 Then
      A2 = Mem : Locate 2 , 7 : Lcd "*" : End If
      If Count = 2 Then
      B2 = Mem : Locate 2 , 8 : Lcd "*" : End If
      If Count = 3 Then
      C2 = Mem : Locate 2 , 9 : Lcd "*" : End If
      If Count = 4 Then
      D2 = Mem : Locate 2 , 10 : Lcd "*" : End If
      If Count > 4 Then
      Count = 0
      A2 = 25 : B2 = 25 : C2 = 25 : D2 = 25
      Cls : End If
      Return





      ببخشید هر کاری کردم نتونسم عکسش رو وارد صفحه کنم
      میشه در مورد منطق برنامه توضیح بدین
      چرا 25؟
      چراa>10 and ..... then a=0 and.....
      آنچه هستی هدیه است از طرف خدا به تو
      و آنچه می توانی باشی هدیه ای است از طرف تو به خدا
      پس بهترین باش
      www.mhedayati.blogfa.com

      دیدگاه

      لطفا صبر کنید...
      X