class test{
private static final String user_path = "D:\\a_user1\\";
private static String GetUserName() {
File[] list = new File(user_path + "username").listFiles();
if (list != null && list.length >= 1) {
return list[0].getName();
}
return null;
}
private static void SetUserName(String UserName) {
File[] list = new File(user_path + "username/").listFiles();
if (list != null && list.length >= 1)
for (File temp : list) {
temp.delete();
}
new File(user_path + "username/" + UserName).mkdirs();
}
public static void main(String[] args) {
System.out.println(GetUserName());
SetUserName("卢四六");
}
}