当前位置: 代码迷 >> J# >> 這串怎么做成CLASS文件運行後,它會要求輸入用戶名和密碼,但是小弟我不知道用戶名和密碼,請各位幫忙
  详细解决方案

這串怎么做成CLASS文件運行後,它會要求輸入用戶名和密碼,但是小弟我不知道用戶名和密碼,請各位幫忙

热度:3645   发布时间:2013-02-25 00:00:00.0
這串如何做成CLASS文件運行後,它會要求輸入用戶名和密碼,但是我不知道用戶名和密碼,請各位幫忙
import java.applet.Applet;
import java.applet.AppletContext;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.EventObject;

public class PasswdLevel4 extends Applet
    implements ActionListener
{

    private URL finalurl = null;
    String infile = null;
    String inuser[] = null;
    int totno = 0;
    InputStream countConn = null;
    BufferedReader countData = null;
    URL inURL = null;
    TextField txtlogin = null;
    Label label1 = null;
    Label label2 = null;
    Label label3 = null;
    TextField txtpass = null;
    Label lblstatus = null;
    Button ButOk = null;
    Button ButReset = null;
    Label lbltitle = null;

    public PasswdLevel4()
    {
        inuser = new String[22];
        totno = 0;
        countConn = null;
        countData = null;
        inURL = null;
        txtlogin = new TextField();
        label1 = new Label();
        label2 = new Label();
        label3 = new Label();
        txtpass = new TextField();
        lblstatus = new Label();
        ButOk = new Button();
        ButReset = new Button();
        lbltitle = new Label();
    }

    void ButOk_ActionPerformed(ActionEvent actionevent)
    {
        boolean flag = false;
        for(int i = 1; i <= totno / 2; i++)
            if(txtlogin.getText().trim().toUpperCase().intern() == inuser[2 * (i - 1) + 2].trim().toUpperCase().intern() && txtpass.getText().trim().toUpperCase().intern() == inuser[2 * (i - 1) + 3].trim().toUpperCase().intern())
            {
                lblstatus.setText("Login Success, Loading..");
                flag = true;
  相关解决方案