Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* */ import java.applet.Applet;
- /* */ import java.applet.AppletContext;
- /* */ import java.awt.Button;
- /* */ import java.awt.Component;
- /* */ import java.awt.Container;
- /* */ import java.awt.Font;
- /* */ import java.awt.Label;
- /* */ import java.awt.TextComponent;
- /* */ import java.awt.TextField;
- /* */ import java.awt.event.ActionEvent;
- /* */ import java.awt.event.ActionListener;
- /* */ import java.io.BufferedReader;
- /* */ import java.io.IOException;
- /* */ import java.io.InputStream;
- /* */ import java.io.InputStreamReader;
- /* */ import java.net.MalformedURLException;
- /* */ import java.net.URL;
- /* */ import java.util.EventObject;
- /* */
- /* */ public class PasswdLevel4 extends Applet
- /* */ implements ActionListener
- /* */ {
- /* */ private URL finalurl;
- /* */ String infile;
- /* 17 */ String[] inuser = new String[22];
- /* 18 */ int totno = 0;
- /* 19 */ InputStream countConn = null;
- /* 20 */ BufferedReader countData = null;
- /* 21 */ URL inURL = null;
- /* 22 */ TextField txtlogin = new TextField();
- /* 23 */ Label label1 = new Label();
- /* 24 */ Label label2 = new Label();
- /* 25 */ Label label3 = new Label();
- /* 26 */ TextField txtpass = new TextField();
- /* 27 */ Label lblstatus = new Label();
- /* 28 */ Button ButOk = new Button();
- /* 29 */ Button ButReset = new Button();
- /* 30 */ Label lbltitle = new Label();
- /* */
- /* */ void ButOk_ActionPerformed(ActionEvent paramActionEvent)
- /* */ {
- /* 35 */ int i = 0;
- /* 36 */ for (int j = 1; j <= this.totno / 2; j++) {
- /* 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()))
- /* */ continue;
- /* 39 */ this.lblstatus.setText("Login Success, Loading..");
- /* 40 */ i = 1;
- /* 41 */ String str1 = this.inuser[1].trim().intern();
- /* 42 */ String str2 = getParameter("targetframe");
- /* 43 */ if (str2 == null)
- /* 44 */ str2 = "_self";
- /* */ try
- /* */ {
- /* 47 */ this.finalurl = new URL(getCodeBase(), str1);
- /* */ }
- /* */ catch (MalformedURLException localMalformedURLException)
- /* */ {
- /* 51 */ this.lblstatus.setText("Bad URL");
- /* */ }
- /* 53 */ getAppletContext().showDocument(this.finalurl, str2);
- /* */ }
- /* */
- /* 56 */ if (i == 0)
- /* 57 */ this.lblstatus.setText("Invaild Login or Password");
- /* */ }
- /* */
- /* */ void ButReset_ActionPerformed(ActionEvent paramActionEvent)
- /* */ {
- /* 62 */ this.txtlogin.setText("");
- /* 63 */ this.txtpass.setText("");
- /* */ }
- /* */
- /* */ public void actionPerformed(ActionEvent paramActionEvent)
- /* */ {
- /* 68 */ Object localObject = paramActionEvent.getSource();
- /* 69 */ if (localObject == this.ButOk) {
- /* 70 */ ButOk_ActionPerformed(paramActionEvent);
- /* */
- /* 69 */ return;
- /* */ }
- /* */
- /* 72 */ if (localObject == this.ButReset)
- /* 73 */ ButReset_ActionPerformed(paramActionEvent);
- /* */ }
- /* */
- /* */ public void destroy()
- /* */ {
- /* 78 */ this.ButOk.setEnabled(false);
- /* 79 */ this.ButReset.setEnabled(false);
- /* 80 */ this.txtlogin.setVisible(false);
- /* 81 */ this.txtpass.setVisible(false);
- /* */ }
- /* */
- /* */ public void inFile()
- /* */ {
- /* 86 */ new StringBuffer();
- /* */ try
- /* */ {
- /* 91 */ this.countConn = this.inURL.openStream();
- /* 92 */ this.countData = new BufferedReader(new InputStreamReader(this.countConn));
- /* */ String str;
- /* 94 */ while ((str = this.countData.readLine()) != null) {
- /* 95 */ if (this.totno < 21)
- /* */ {
- /* 97 */ this.totno += 1;
- /* 98 */ this.inuser[this.totno] = str;
- /* 99 */ str = "";
- /* */ }
- /* */ else
- /* */ {
- /* 104 */ this.lblstatus.setText("Cannot Exceed 10 users, Applet fail start!");
- /* 105 */ destroy();
- /* */ }
- /* */ }
- /* */ }
- /* */ catch (IOException localIOException1)
- /* */ {
- /* 111 */ getAppletContext().showStatus("IO Error:" + localIOException1.getMessage());
- /* */ }
- /* */ try
- /* */ {
- /* 115 */ this.countConn.close();
- /* 116 */ this.countData.close();
- /* */
- /* 113 */ return;
- /* */ }
- /* */ catch (IOException localIOException2)
- /* */ {
- /* 120 */ getAppletContext().showStatus("IO Error:" + localIOException2.getMessage());
- /* */ }
- /* */ }
- /* */
- /* */ public void init()
- /* */ {
- /* 126 */ setLayout(null);
- /* 127 */ setSize(361, 191);
- /* 128 */ add(this.txtlogin);
- /* 129 */ this.txtlogin.setBounds(156, 72, 132, 24);
- /* 130 */ this.label1.setText("Please Enter Login Name & Password");
- /* 131 */ this.label1.setAlignment(1);
- /* 132 */ add(this.label1);
- /* 133 */ this.label1.setFont(new Font("Dialog", 1, 12));
- /* 134 */ this.label1.setBounds(41, 36, 280, 24);
- /* 135 */ this.label2.setText("Login");
- /* 136 */ add(this.label2);
- /* 137 */ this.label2.setFont(new Font("Dialog", 1, 12));
- /* 138 */ this.label2.setBounds(75, 72, 36, 24);
- /* 139 */ this.label3.setText("Password");
- /* 140 */ add(this.label3);
- /* 141 */ add(this.txtpass);
- /* 142 */ this.txtpass.setEchoChar('*');
- /* 143 */ this.txtpass.setBounds(156, 108, 132, 24);
- /* 144 */ this.lblstatus.setAlignment(1);
- /* 145 */ this.label3.setFont(new Font("Dialog", 1, 12));
- /* 146 */ this.label3.setBounds(75, 108, 57, 21);
- /* 147 */ add(this.lblstatus);
- /* 148 */ this.lblstatus.setFont(new Font("Dialog", 1, 12));
- /* 149 */ this.lblstatus.setBounds(14, 132, 344, 24);
- /* 150 */ this.ButOk.setLabel("OK");
- /* 151 */ add(this.ButOk);
- /* 152 */ this.ButOk.setFont(new Font("Dialog", 1, 12));
- /* 153 */ this.ButOk.setBounds(105, 156, 59, 23);
- /* 154 */ this.ButReset.setLabel("Reset");
- /* 155 */ add(this.ButReset);
- /* 156 */ this.ButReset.setFont(new Font("Dialog", 1, 12));
- /* 157 */ this.ButReset.setBounds(204, 156, 59, 23);
- /* 158 */ this.lbltitle.setAlignment(1);
- /* 159 */ add(this.lbltitle);
- /* 160 */ this.lbltitle.setFont(new Font("Dialog", 1, 12));
- /* 161 */ this.lbltitle.setBounds(12, 14, 336, 24);
- /* 162 */ String str = getParameter("title");
- /* 163 */ this.lbltitle.setText(str);
- /* 164 */ this.ButOk.addActionListener(this);
- /* 165 */ this.ButReset.addActionListener(this);
- /* 166 */ this.infile = new String("level4");
- /* */ try
- /* */ {
- /* 169 */ this.inURL = new URL(getCodeBase(), this.infile);
- /* */ }
- /* */ catch (MalformedURLException localMalformedURLException)
- /* */ {
- /* 173 */ getAppletContext().showStatus("Bad Counter URL:" + this.inURL);
- /* */ }
- /* 175 */ inFile();
- /* */ }
- /* */ }
- /* Location: /root/Desktop/
- * Qualified Name: PasswdLevel4
- * JD-Core Version: 0.6.0
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement