public static void SetSSoTmeKey(SSOTMEKey value, string account = "") { FileInfo ssotmeKeyFI = GetKeyForAccount(account); String ssotmeJson = JsonConvert.SerializeObject(value, Formatting.Indented); File.WriteAllText(ssotmeKeyFI.FullName, ssotmeJson); }
public static SSOTMEKey GetSSoTmeKey(string runAs = "") { FileInfo ssotmeKeyFI = GetKeyForAccount(runAs); var ssotmeKey = default(SSOTMEKey); if (ssotmeKeyFI.Exists) { ssotmeKey = JsonConvert.DeserializeObject <SSOTMEKey>(File.ReadAllText(ssotmeKeyFI.FullName)); } else { ssotmeKey = new SSOTMEKey(); } return(ssotmeKey); }