first Commit
commit
d3b28c9019
|
@ -0,0 +1,46 @@
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.FileWriter;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
public class ConfigDatei {
|
||||||
|
|
||||||
|
private String firmenname = "Firma1";
|
||||||
|
private String Firmenadresse;
|
||||||
|
private String Bankverbindung;
|
||||||
|
private static String configFile = "config.cfg";
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Scanner sc = new Scanner(System.in);
|
||||||
|
|
||||||
|
File tmpFile = new File(configFile);
|
||||||
|
boolean exists = tmpFile.exists();
|
||||||
|
if (exists = false) {
|
||||||
|
try {
|
||||||
|
FileWriter fw = new FileWriter(configFile);
|
||||||
|
System.out.println("Bitte geben sie Ihren Firmennamen ein: ");
|
||||||
|
String name = sc.nextLine();
|
||||||
|
System.out.println("Bitte geben sie Ihre Firmenadresse ein: ");
|
||||||
|
String adresse = sc.nextLine();
|
||||||
|
System.out.println("Bitte geben sie Ihre Bankverbindung ein: ");
|
||||||
|
String bankverbindung = sc.nextLine();
|
||||||
|
char quote = '"';
|
||||||
|
fw.write("Firmenname: " + quote + name);
|
||||||
|
fw.write("Firmenadresse: " +quote +adresse);
|
||||||
|
fw.write("Bankverbindung: " +);
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else{
|
||||||
|
BufferedReader br= new BufferedReader(new FileReader(configFile));
|
||||||
|
br.read();
|
||||||
|
}}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue