Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- axios
- javscript
- 연동
- programmers
- mixins
- 음양더하기
- javascipt
- node.js
- v-if
- kibana
- v-for
- 콘솔한글깨짐
- Emit
- IntelliJ
- mutations
- vuex
- getters
- Express.js
- Login
- 템플릿문법
- state
- Vue.js
- react
- KAKAO
- JavaScript
- Reduce
- includes
- azure
- sns로그인
- v-on
Archives
- Today
- Total
공부용
회원가입 본문
아이디 중복검사
Path path = new Path();
String readPath = path.userPath+"userList.txt";
File file = new File(readPath);
BufferedReader reader = new BufferedReader(new FileReader(file));
BufferedWriter writer = new BufferedWriter(new FileWriter(file, true));
String line = "";
Scanner scan = new Scanner(System.in);
while((line = reader.readLine()) != null) {
String []info = line.split("■");
if(info[0].indexOf(str) > -1) {
System.out.println("\t\t\t중복된 아이디가 존재합니다.");
return false;
}//if(중복아이디검사)
}//while
//유효성검사 통과
return true;
새롭게 가입이 되면 기초정보파일을 생성
String [] info = str.split("■");
readPath = path.userPath;
System.out.println(info[0]);
File newFile = new File(readPath+"userInfo\\"+info[0]+".txt"); //유저정보
newFile.createNewFile();
writer = new BufferedWriter(new FileWriter(newFile));
writer.write("B■500\n");//브론즈 0포인트 -> 새로 생성된 아이디이므로
writer.close();
newFile = new File(readPath+"userCoupon\\"+info[0]+".txt"); //쿠폰정보
newFile.createNewFile();
writer = new BufferedWriter(new FileWriter(newFile));
writer.write("discount3");//
writer.close();
newFile = new File(readPath+"userCard\\"+info[0]+".txt"); //카드정보
newFile.createNewFile();
writer = new BufferedWriter(new FileWriter(newFile));
writer.write("0");//브론즈 0포인트 -> 새로 생성된 아이디이므로
writer.close();
결과화면
'2020.10 ~ 2021.03 취업성공패키지 > 영화관 관리(Java)' 카테고리의 다른 글
좌석선택 (0) | 2021.01.20 |
---|---|
영화관 선택 (0) | 2021.01.20 |
영화 선택 (0) | 2021.01.20 |
로그인 (0) | 2021.01.17 |
아이디/비밀번호 찾기 (0) | 2021.01.17 |
Comments