示例#1
0
        public static void SetSSoTmeKey(SSOTMEKey value, string account = "")
        {
            FileInfo ssotmeKeyFI = GetKeyForAccount(account);
            String   ssotmeJson  = JsonConvert.SerializeObject(value, Formatting.Indented);

            File.WriteAllText(ssotmeKeyFI.FullName, ssotmeJson);
        }
示例#2
0
        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);
        }