Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 7.41 KB | None | 0 0
  1. /*     */ import java.applet.Applet;
  2. /*     */ import java.applet.AppletContext;
  3. /*     */ import java.awt.Button;
  4. /*     */ import java.awt.Component;
  5. /*     */ import java.awt.Container;
  6. /*     */ import java.awt.Font;
  7. /*     */ import java.awt.Label;
  8. /*     */ import java.awt.TextComponent;
  9. /*     */ import java.awt.TextField;
  10. /*     */ import java.awt.event.ActionEvent;
  11. /*     */ import java.awt.event.ActionListener;
  12. /*     */ import java.io.BufferedReader;
  13. /*     */ import java.io.IOException;
  14. /*     */ import java.io.InputStream;
  15. /*     */ import java.io.InputStreamReader;
  16. /*     */ import java.net.MalformedURLException;
  17. /*     */ import java.net.URL;
  18. /*     */ import java.util.EventObject;
  19. /*     */
  20. /*     */ public class PasswdLevel4 extends Applet
  21. /*     */   implements ActionListener
  22. /*     */ {
  23. /*     */   private URL finalurl;
  24. /*     */   String infile;
  25. /*  17 */   String[] inuser = new String[22];
  26. /*  18 */   int totno = 0;
  27. /*  19 */   InputStream countConn = null;
  28. /*  20 */   BufferedReader countData = null;
  29. /*  21 */   URL inURL = null;
  30. /*  22 */   TextField txtlogin = new TextField();
  31. /*  23 */   Label label1 = new Label();
  32. /*  24 */   Label label2 = new Label();
  33. /*  25 */   Label label3 = new Label();
  34. /*  26 */   TextField txtpass = new TextField();
  35. /*  27 */   Label lblstatus = new Label();
  36. /*  28 */   Button ButOk = new Button();
  37. /*  29 */   Button ButReset = new Button();
  38. /*  30 */   Label lbltitle = new Label();
  39. /*     */
  40. /*     */   void ButOk_ActionPerformed(ActionEvent paramActionEvent)
  41. /*     */   {
  42. /*  35 */     int i = 0;
  43. /*  36 */     for (int j = 1; j <= this.totno / 2; j++) {
  44. /*  37 */       if ((this.txtlogin.getText().trim().toUpperCase().intern() != this.inuser[(2 * (j - 1) + 2)].trim().toUpperCase().intern()) || (this.txtpass.getText().trim().toUpperCase().intern() != this.inuser[(2 * (j - 1) + 3)].trim().toUpperCase().intern()))
  45. /*     */         continue;
  46. /*  39 */       this.lblstatus.setText("Login Success, Loading..");
  47. /*  40 */       i = 1;
  48. /*  41 */       String str1 = this.inuser[1].trim().intern();
  49. /*  42 */       String str2 = getParameter("targetframe");
  50. /*  43 */       if (str2 == null)
  51. /*  44 */         str2 = "_self";
  52. /*     */       try
  53. /*     */       {
  54. /*  47 */         this.finalurl = new URL(getCodeBase(), str1);
  55. /*     */       }
  56. /*     */       catch (MalformedURLException localMalformedURLException)
  57. /*     */       {
  58. /*  51 */         this.lblstatus.setText("Bad URL");
  59. /*     */       }
  60. /*  53 */       getAppletContext().showDocument(this.finalurl, str2);
  61. /*     */     }
  62. /*     */
  63. /*  56 */     if (i == 0)
  64. /*  57 */       this.lblstatus.setText("Invaild Login or Password");
  65. /*     */   }
  66. /*     */
  67. /*     */   void ButReset_ActionPerformed(ActionEvent paramActionEvent)
  68. /*     */   {
  69. /*  62 */     this.txtlogin.setText("");
  70. /*  63 */     this.txtpass.setText("");
  71. /*     */   }
  72. /*     */
  73. /*     */   public void actionPerformed(ActionEvent paramActionEvent)
  74. /*     */   {
  75. /*  68 */     Object localObject = paramActionEvent.getSource();
  76. /*  69 */     if (localObject == this.ButOk) {
  77. /*  70 */       ButOk_ActionPerformed(paramActionEvent);
  78. /*     */
  79. /*  69 */       return;
  80. /*     */     }
  81. /*     */
  82. /*  72 */     if (localObject == this.ButReset)
  83. /*  73 */       ButReset_ActionPerformed(paramActionEvent);
  84. /*     */   }
  85. /*     */
  86. /*     */   public void destroy()
  87. /*     */   {
  88. /*  78 */     this.ButOk.setEnabled(false);
  89. /*  79 */     this.ButReset.setEnabled(false);
  90. /*  80 */     this.txtlogin.setVisible(false);
  91. /*  81 */     this.txtpass.setVisible(false);
  92. /*     */   }
  93. /*     */
  94. /*     */   public void inFile()
  95. /*     */   {
  96. /*  86 */     new StringBuffer();
  97. /*     */     try
  98. /*     */     {
  99. /*  91 */       this.countConn = this.inURL.openStream();
  100. /*  92 */       this.countData = new BufferedReader(new InputStreamReader(this.countConn));
  101. /*     */       String str;
  102. /*  94 */       while ((str = this.countData.readLine()) != null) {
  103. /*  95 */         if (this.totno < 21)
  104. /*     */         {
  105. /*  97 */           this.totno += 1;
  106. /*  98 */           this.inuser[this.totno] = str;
  107. /*  99 */           str = "";
  108. /*     */         }
  109. /*     */         else
  110. /*     */         {
  111. /* 104 */           this.lblstatus.setText("Cannot Exceed 10 users, Applet fail start!");
  112. /* 105 */           destroy();
  113. /*     */         }
  114. /*     */       }
  115. /*     */     }
  116. /*     */     catch (IOException localIOException1)
  117. /*     */     {
  118. /* 111 */       getAppletContext().showStatus("IO Error:" + localIOException1.getMessage());
  119. /*     */     }
  120. /*     */     try
  121. /*     */     {
  122. /* 115 */       this.countConn.close();
  123. /* 116 */       this.countData.close();
  124. /*     */
  125. /* 113 */       return;
  126. /*     */     }
  127. /*     */     catch (IOException localIOException2)
  128. /*     */     {
  129. /* 120 */       getAppletContext().showStatus("IO Error:" + localIOException2.getMessage());
  130. /*     */     }
  131. /*     */   }
  132. /*     */
  133. /*     */   public void init()
  134. /*     */   {
  135. /* 126 */     setLayout(null);
  136. /* 127 */     setSize(361, 191);
  137. /* 128 */     add(this.txtlogin);
  138. /* 129 */     this.txtlogin.setBounds(156, 72, 132, 24);
  139. /* 130 */     this.label1.setText("Please Enter Login Name & Password");
  140. /* 131 */     this.label1.setAlignment(1);
  141. /* 132 */     add(this.label1);
  142. /* 133 */     this.label1.setFont(new Font("Dialog", 1, 12));
  143. /* 134 */     this.label1.setBounds(41, 36, 280, 24);
  144. /* 135 */     this.label2.setText("Login");
  145. /* 136 */     add(this.label2);
  146. /* 137 */     this.label2.setFont(new Font("Dialog", 1, 12));
  147. /* 138 */     this.label2.setBounds(75, 72, 36, 24);
  148. /* 139 */     this.label3.setText("Password");
  149. /* 140 */     add(this.label3);
  150. /* 141 */     add(this.txtpass);
  151. /* 142 */     this.txtpass.setEchoChar('*');
  152. /* 143 */     this.txtpass.setBounds(156, 108, 132, 24);
  153. /* 144 */     this.lblstatus.setAlignment(1);
  154. /* 145 */     this.label3.setFont(new Font("Dialog", 1, 12));
  155. /* 146 */     this.label3.setBounds(75, 108, 57, 21);
  156. /* 147 */     add(this.lblstatus);
  157. /* 148 */     this.lblstatus.setFont(new Font("Dialog", 1, 12));
  158. /* 149 */     this.lblstatus.setBounds(14, 132, 344, 24);
  159. /* 150 */     this.ButOk.setLabel("OK");
  160. /* 151 */     add(this.ButOk);
  161. /* 152 */     this.ButOk.setFont(new Font("Dialog", 1, 12));
  162. /* 153 */     this.ButOk.setBounds(105, 156, 59, 23);
  163. /* 154 */     this.ButReset.setLabel("Reset");
  164. /* 155 */     add(this.ButReset);
  165. /* 156 */     this.ButReset.setFont(new Font("Dialog", 1, 12));
  166. /* 157 */     this.ButReset.setBounds(204, 156, 59, 23);
  167. /* 158 */     this.lbltitle.setAlignment(1);
  168. /* 159 */     add(this.lbltitle);
  169. /* 160 */     this.lbltitle.setFont(new Font("Dialog", 1, 12));
  170. /* 161 */     this.lbltitle.setBounds(12, 14, 336, 24);
  171. /* 162 */     String str = getParameter("title");
  172. /* 163 */     this.lbltitle.setText(str);
  173. /* 164 */     this.ButOk.addActionListener(this);
  174. /* 165 */     this.ButReset.addActionListener(this);
  175. /* 166 */     this.infile = new String("level4");
  176. /*     */     try
  177. /*     */     {
  178. /* 169 */       this.inURL = new URL(getCodeBase(), this.infile);
  179. /*     */     }
  180. /*     */     catch (MalformedURLException localMalformedURLException)
  181. /*     */     {
  182. /* 173 */       getAppletContext().showStatus("Bad Counter URL:" + this.inURL);
  183. /*     */     }
  184. /* 175 */     inFile();
  185. /*     */   }
  186. /*     */ }
  187.  
  188. /* Location:           /root/Desktop/
  189. * Qualified Name:     PasswdLevel4
  190. * JD-Core Version:    0.6.0
  191. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement