gönderen Serdar TÜRKEL » Pzr Şub 07, 2010 2:25 am
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author serdar türkel
*/
public class PassFile {
public static void main(String[] args) {
try {
String file = "c:\\password.txt";
File f = new File(file);
if (!f.exists()) {
f.createNewFile();
}
FileInputStream fis = new FileInputStream(f);
InputStreamReader isrd = new InputStreamReader(fis);
BufferedReader bfr = new BufferedReader(isrd);
String password = "";
if (bfr.ready()) {
password = bfr.readLine();
}
if (password.equals("1234")) {
System.out.println("Login Success");
} else {
System.out.println("Login Failed!");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}