home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / userco_1 / security.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-08-26  |  4.9 KB  |  121 lines

  1. VERSION 5.00
  2. Begin VB.Form SecurityForm 
  3.    BackColor       =   &H8000000A&
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "-Security-"
  6.    ClientHeight    =   1350
  7.    ClientLeft      =   45
  8.    ClientTop       =   405
  9.    ClientWidth     =   3255
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1350
  14.    ScaleWidth      =   3255
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   3  'Windows Default
  17.    Begin VB.TextBox WrongCounter 
  18.       Height          =   375
  19.       Left            =   3360
  20.       MaxLength       =   1
  21.       TabIndex        =   3
  22.       Text            =   "3"
  23.       Top             =   120
  24.       Width           =   255
  25.    End
  26.    Begin VB.TextBox PasswordText 
  27.       Height          =   375
  28.       Left            =   120
  29.       TabIndex        =   2
  30.       Text            =   "Enter the Password!"
  31.       Top             =   120
  32.       Width           =   3015
  33.    End
  34.    Begin VB.CommandButton ExitButton 
  35.       Caption         =   "Exit"
  36.       Height          =   495
  37.       Left            =   1680
  38.       MousePointer    =   10  'Up Arrow
  39.       TabIndex        =   1
  40.       Top             =   720
  41.       Width           =   1455
  42.    End
  43.    Begin VB.CommandButton EnterButton 
  44.       Caption         =   "Enter"
  45.       Height          =   495
  46.       Left            =   120
  47.       MousePointer    =   10  'Up Arrow
  48.       TabIndex        =   0
  49.       Top             =   720
  50.       Width           =   1455
  51.    End
  52. Attribute VB_Name = "SecurityForm"
  53. Attribute VB_GlobalNameSpace = False
  54. Attribute VB_Creatable = False
  55. Attribute VB_PredeclaredId = True
  56. Attribute VB_Exposed = False
  57. '--------------------------------------------------------------------
  58. Rem Made 
  59. y: Mike Canejo
  60. Rem E-mail me at: IamMikeC@aol.com
  61. '--------------------------------------------------------------------
  62. Private Sub EnterButton_Click() 'if the Enter button is clicked then do the below
  63. If PasswordText = LCase$("password") Then
  64. 'If the password is X then do something
  65. MsgBox "Correct password!", vbSystemModal + vbInformation + vbOKOnly, "Valid"
  66. 'If its right, display this message
  67. MsgBox "Put your code here to do something if its right", vbSystemModal + vbInformation + vbOKOnly, "Command here" 'replace this line with your choice if it's right
  68. If WrongCounter = "1" Then
  69. 'if the counter is 1 then do this
  70. This& = MsgBox("Your system will now crash!", vbSystemModal + vbOKCancel, "Confirm")
  71. 'display message
  72. If This& = vbCancel Then MsgBox "-Sorry...You cant Cancel!", vbSystemModal + vbCritical + vbOKOnly, "Error"
  73. 'if the user clicks Cancel then do this
  74. MsgBox "Your System is now crashing. Please wait..", vbSystemModal + vbInformation + vbOKOnly, "Info"
  75. 'displays message'i did this just for a prank or joke..it doesnt really harm your computer in any way :)
  76. 'ScreenBlackOut Me
  77. 'WinShutdown
  78. 'WinReboot
  79. 'WinForceClose'---------------------------[Pick a command to use]
  80. 'WinLogUserOff
  81. 'HideTaskbar
  82. 'HideWindowsToolBar
  83. 'HideStartButton
  84. 'Use one of these Commands if the password is wrong 3 times
  85. WrongCounter = "3" 'Counter = "3" to start over
  86. End 'Ends program
  87. End If 'Ends the If
  88. WrongCounter = Val(WrongCounter) - 1 'make the counter 1 number less than it was
  89. If WrongCounter = "1" Then 'i used this to make the message make sense
  90. MsgBox "The password you've entered is invalid! You have " & WrongCounter & " try left until System Failure!", vbSystemModal + vbCritical + vbOKOnly, "Error"
  91. 'displays error message
  92. MsgBox "The password you've entered is invalid! You have " & WrongCounter & " tries left until System Failure!", vbSystemModal + vbCritical + vbOKOnly, "Error"
  93. 'displays error message
  94. End If 'End the If
  95. End If 'End the If
  96. End Sub
  97. Private Sub ExitButton_Click() 'If the Exit button is clciked then do the below
  98. Unload Me 'Unload the program
  99. End Sub
  100. Private Sub Form_Load() ' when the form loads, do this
  101. CenterForm Me 'Centers the form in the screen
  102. StayOnTop Me 'Keeps the form OnTop of everything
  103. 'PreventFromClosing
  104. 'DisableCtrlAltDel
  105. 'EnableCtrlAltDel
  106. Rem Use a command for the loading part
  107. End Sub
  108. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) 'when the user clicks unload or the X button
  109. 'use this incase the user clicks the unload from the taskbar
  110. Value& = MsgBox("Are you sure you want to exit?", vbSystemModal + vbInformation + vbYesNo, "Exit")
  111. 'hold outcome of the message
  112. If Value& = vbYes Then 'if the user clicks Yes then do something
  113. End 'do this when the user clicks Yes
  114. End If 'Ends the If
  115. Cancel = 1 'makes the form not unload automatically ..only unloads from the above Yes or No statement
  116. End Sub
  117. Private Sub PasswordText_Click() 'if the textbox is clicked then check for text
  118. If PasswordText = "Enter the Password!" Then PasswordText = ""
  119. 'clears the textbox if it has the X text in it
  120. End Sub
  121.