⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 account.java

📁 应用RMS实现用户自动登陆功能
💻 JAVA
字号:
/*
 * Created on 2004-11-4
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.j2medev.autologin;

import java.io.*;

/**
 * @author P2800
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class Account
{
    private String userName;
    private String password;

    public Account(String _userName, String _password)
    {
        this.userName = _userName;
        this.password = _password;
    }

    public Account()
    {

    }

    public void serialize(DataOutputStream dos) throws IOException
    {
        dos.writeUTF(userName);
        dos.writeUTF(password);
    }

    public static Account deserialize(DataInputStream dis) throws IOException
    {
        Account account = new Account();
        account.setUsrName(dis.readUTF());
        account.setPassword(dis.readUTF());

        return account;
    }

    /**
     * @return Returns the password.
     */
    public String getPassword()
    {
        return password;
    }

    /**
     * @param password
     *            The password to set.
     */
    public void setPassword(String password)
    {
        this.password = password;
    }

    /**
     * @return Returns the usrName.
     */
    public String getUsrName()
    {
        return userName;
    }

    /**
     * @param usrName
     *            The usrName to set.
     */
    public void setUsrName(String usrName)
    {
        this.userName = usrName;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -