Advertisement
Guest User

Untitled

a guest
Mar 28th, 2018
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.14 KB | None | 0 0
  1. <head>
  2. <title>Login</title>
  3. <HTA:APPLICATION
  4. APPLICATIONNAME="Login"
  5. BORDER="dialog"
  6. BORDERSTYLE="normal"
  7. CAPTION="no"
  8. CONTEXTMENU="no"
  9. ICON="icon.ico"
  10. INNERBORDER="yes"
  11. MAXIMIZEBUTTON="no"
  12. MINIMIZEBUTTON="no"
  13. NAVIGABLE="yes"
  14. SCROLL="no"
  15. SHOWINTASKBAR="yes"
  16. SINGLEINSTANCE="yes"
  17. SYSMENU="yes"
  18. VERSION="1.1"
  19. WINDOWSTATE="normal"
  20. />
  21.  
  22.  
  23. </head>
  24. <script language = "VBScript">
  25. window.resizeto 350,200
  26. Public strUsername, strPassword
  27.  
  28.  
  29. screenWidth=Document.ParentWindow.Screen.AvailWidth
  30. screenHeight=Document.parentWindow.Screen.AvailHeight
  31. posLeft=(ScreenWidth-350)/2
  32. posTop=(screenHeight-200)/2
  33. window.moveTo posLeft,posTop
  34.  
  35.  
  36. Sub strStart
  37. strUsername=Username.value
  38. strPassword=Password.value
  39.  
  40. UserInfo.style.visibility="hidden"
  41. UserNotFound.style.visibility="hidden"
  42. PassNotFound.style.visibility="hidden"
  43. UserPassEmpty.style.visibility="hidden"
  44.  
  45. if strUsername="" then
  46. UserNotFound.style.visibility="visible"
  47. PassNotFound.style.visibility="hidden"
  48. UserPassEmpty.style.visibility="hidden"
  49. End if
  50.  
  51. if strPassword="" then
  52. UserNotFound.style.visibility="hidden"
  53. PassNotFound.style.visibility="visible"
  54. UserPassEmpty.style.visibility="hidden"
  55. End if
  56.  
  57. if strUsername="" and strPassword="" then
  58. UserNotFound.style.visibility="hidden"
  59. PassNotFound.style.visibility="hidden"
  60. UserPassEmpty.style.visibility="visible"
  61. end if
  62.  
  63. if strUsername<>"" and strPassword<>"" then
  64. idTimer=setTimeout("strEnter",50,"VBScript")
  65. End if
  66. End Sub
  67.  
  68.  
  69.  
  70. Sub strEnter
  71.  
  72. UserNotFound.style.visibility="hidden"
  73. PassNotFound.style.visibility="hidden"
  74. UserPassEmpty.style.visibility="hidden"
  75. UserInfo.style.visibility="visible"
  76. Set wss = CreateObject("Wscript.shell")
  77. Set fso = CreateObject("Scripting.FileSystemObject")
  78.  
  79. strUsername = Username.Value
  80. strPassword = Password.value
  81. strFile = "Login.txt"
  82.  
  83. FileArray = fso.OpenTextFile(strFile).ReadAll
  84. LinebyLine = Split(FileArray, vbCrLF)
  85.  
  86. For Each Line in LinebyLine
  87. 'Have this sub read the files line by line.
  88. strCheck = Split(Line,"/")
  89. strUN = strCheck(0)
  90. strPW = strCheck(1)
  91. if strUN = strUsername then
  92. exit for
  93. end if
  94. Next
  95.  
  96. if strUN=strUsername and strPW=strPassword then
  97. UserInfo.style.visibility="hidden"
  98. msgbox "Credentials found. Welcome " & strUsername
  99. Set wss = CreateObject("WScript.Shell")
  100. wss.Run "C:\Users\alenp\Desktop\Projects\opentaskbars.hta"
  101. self.close()
  102. End if
  103.  
  104. if strUN=strUsername and strPW<>strPassword then
  105. UserInfo.InnerHTML= "Incorrect password"
  106. End if
  107.  
  108. if strUN<>strUsername then
  109. UserInfo.InnerHTML= "Username not found"
  110. End if
  111. End Sub
  112.  
  113. Sub enterpassword
  114. if PasswordArea.value="rose" then
  115. msgbox"Logged in!"
  116. Dim wss
  117. Set wss = CreateObject("WScript.Shell")
  118. wss.Run "choice.bat"
  119. else
  120. msgbox"Invalid password!"
  121. end if
  122. end sub
  123.  
  124. </script>
  125.  
  126. <SCRIPT LANGUAGE="JavaScript">
  127. function document.onkeydown() {
  128. var alt=window.event.altKey;
  129. if (event.keyCode==116 || event.keyCode==27 || alt && event.keyCode==115) {
  130. event.keyCode=0;
  131. event.cancelBubble=true;
  132. return false;
  133. }
  134. }
  135. </SCRIPT>
  136.  
  137. <body style="background-color:white; color:black;"style="border: 3pt ridge black">
  138. <span style="position: relative; color:black;
  139. top:-3px";
  140. >
  141. Username:
  142. </span>
  143. <input type="Text" name="Username" size="36" style="background-color:white; color:black; border: 2pt ridge black"> <br> <br>
  144. <span style="position: relative; color:black;
  145. top:-3px">
  146. Password:
  147. </span>
  148. <input type="password" name="Password" size="36" style="background-color:white; color:black; border: 2pt ridge black"> <br>
  149. <br> <input type="button" value="L O G I N" onclick="strStart" style="background-color:white; color:black; border: 2pt ridge black">
  150. <span id="UserNotFound"; style="position: absolute; top:80; left:83; visibility:hidden">
  151. Username not found.
  152. </span>
  153. <span id="PassNotFound"; style="position: absolute; top:80; left:83; visibility:hidden">
  154. Incorrect password.
  155. </span>
  156. <span id="UserPassEmpty"; style="position: absolute; top:80; left:83; visibility:hidden">
  157. Enter your credentials
  158. </span>
  159. <span id="UserInfo"; style="position: absolute; top:80; left:83">
  160. </span>
  161. <p>
  162. <input type="button" value="Close" name="run_button" onClick="self.close() " style="background-color:white; color:black; border: 2pt ridge black">
  163. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement