예제 #1
0
파일: json.cs 프로젝트: OvO-Dev/a3laucher
        public void create_json_file()                                                          // If there is no settings.json (example First Start) it will create a new Json file
        {
            appSettings json = new appSettings();

            json.gamepath       = @"C:\Program Files (x86)\Steam\steamapps\common\Arma 3\arma3.exe"; // Standard Path
            json.param          = "-YourParamsHere";                                                 // Standard Params
            json.checkBoxParams = "";
            json.mode           = "dark";

            string jsonString = JsonConvert.SerializeObject(json);                              // Converts the "appSettings" Class to string

            File.WriteAllText(path, jsonString);
        }
예제 #2
0
파일: json.cs 프로젝트: OvO-Dev/a3laucher
        public void save_json_file(string param, string gamepath, string extra, string Mode)                               // Saves the Json
        {
            appSettings json = new appSettings();

            json.gamepath       = gamepath;
            json.param          = param;
            json.checkBoxParams = extra;
            json.mode           = Mode;

            string jsonString = JsonConvert.SerializeObject(json);

            File.WriteAllText(path, jsonString);
        }
예제 #3
0
파일: json.cs 프로젝트: OvO-Dev/a3laucher
        public jsonparser(string pfad)
        {
            path = pfad;

            if (!check())
            {
                create_json_file();
                settingsJSON = load_json_file();
            }
            else
            {
                settingsJSON = load_json_file();
            }

            settings = JsonConvert.DeserializeObject <appSettings>(settingsJSON);
        }