Beispiel #1
0
 public void ResetSensitiveInfoTo(ProxyDetails other)
 {
     if (SENSITIVE_VALUE_REPLACER.Equals(other.Password))
     {
         other.Password = this.Password;
     }
 }
        public static void WriteConfig(ProxyDetails config)
        {
            var configFile = GetConfigFilePath();
            var configText = JsonHelper.SerializeObject(config.GetSecuredInstance(), true);

            File.WriteAllText(configFile, configText);
            Log.Info($"Writing proxy settings done");
        }
 /*!
  * Used for connDetails that was received from UI with replaced sensitive info by SENSITIVE_VALUE_REPLACER.
  * Here it will be replaced back to real values.
  *
  */
 public static void ResetSensitiveInfo(ProxyDetails connDetails)
 {
     try
     {
         if (String.IsNullOrEmpty(connDetails.User))
         {
             connDetails.Password = null;
         }
         else
         {
             ProxyDetails connFromFs = Read(false);
             connFromFs.ResetSensitiveInfoTo(connDetails);
         }
     }
     catch (FileNotFoundException)
     {
         //do nothing, configuration file still not exist
     }
 }