public string ini_mode() // { using (FileStream fs = new FileStream("setting.json", FileMode.Open)) { using (StreamReader sr = new StreamReader(fs)) { SetHost m = JsonConvert.DeserializeObject <SetHost>(sr.ReadLine()); string result = m.mode; return(result); } } }
public string write_url_json(string mode, string host) // { using (FileStream fs = new FileStream("setting.json", FileMode.Create)) { using (StreamWriter writer = new StreamWriter(fs)) { SetHost sh = new SetHost(); sh.mode = mode; sh.host = host; sh.client = GetMyIp(); string str = JsonConvert.SerializeObject(sh); writer.WriteLine(str); return(string.Empty); } } }