Provides access to read and write to the shared credentials INI file. The file is read, parsed, and validated at construction time. Changes can be made using the AddOrUpdateSection() and DeleteSection() methods. Those changes can be persisted to disk using the Persist() method. This class is not threadsafe.
コード例 #1
0
 public SharedCredentialsFileTester(bool createFile = false)
 {
     if (createFile)
     {
         FilePath = Path.GetTempFileName();
     }
     else
     {
         FilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
     }
     CredentialsFile = new SharedCredentialsFile(FilePath);
 }
コード例 #2
0
 public SharedCredentialsFileTester(string fileContents)
 {
     FilePath = Path.GetTempFileName();
     File.WriteAllText(FilePath, fileContents);
     CredentialsFile = new SharedCredentialsFile(FilePath);
 }