title: Save and read AppSetting from Access File with password in C#
body: <p>I have class which read and save AppSetting from text file. Now I want to change the txt file to Access File with password. The problem is I don't know how to write it. Here is my code:</p>
  
  <pre><code>public static string HashKey = "hometelaccess";
      static readonly string filePath = Application.StartupPath + "/Server.txt";
      public static string GetValue(string key)
      {
          key = key.ToLower();
          List&lt;KeyValue&gt; lstKeyValue = GetLstKeyValue();
          return lstKeyValue.FirstOrDefault(x =&gt; x.Key == key)?.Value.Decrypt(HashKey);
      }
      private static List&lt;KeyValue&gt; GetLstKeyValue()
      {
          List&lt;KeyValue&gt; lstKeyValue = new List&lt;KeyValue&gt;();
          List&lt;string&gt; lstLine = File.ReadAllLines(filePath).ToList();
          foreach (var line in lstLine)
          {
              string[] strTmp = line.Split(','); 
              lstKeyValue.Add(new KeyValue { Key = strTmp[0], Value = strTmp[1] });
          }
          return lstKeyValue;
      }
      public static void SaveToConfig(string key, string value)
      {
          key = key.ToLower();
          if (!File.Exists(filePath))
              File.Create(filePath);
          List&lt;KeyValue&gt; lstKeyValue = GetLstKeyValue();
          KeyValue keyValue = lstKeyValue.FirstOrDefault(x =&gt; x.Key == key);
          if (keyValue == null)
              lstKeyValue.Add(new KeyValue { Key = key, Value = value.Encrypt(HashKey) });
          else keyValue.Value = value.Encrypt(HashKey);
          File.WriteAllLines(filePath, lstKeyValue.Select(x =&gt; x.Key + "," + x.Value));
      }
  }
  </code></pre>
  
  <p>My problem is I really don't know how to connect this Access File which has password and how to read from it.</p>