title: Parse ConnectionString with = symbol
body: <p>I am trying to parse a connection string and extract values to be used in code. The problem is that one of the values in my connections string has an <code>=</code> symbol. </p>
  
  <p>Here is the code I have</p>
  
  <pre><code>private void Parse(string connectionString)
  {
      var components = connectionString.Split(';');
      foreach (var component in components)
      {
          if (string.IsNullOrEmpty(component)) continue;
  
          var fieldValuePair = component.Trim().Split('=');//Problematic? Don't know how to fix!
          var field = fieldValuePair[0].ToLower();
          var value = fieldValuePair[1];
  
          switch (field)
          {
              case "url":
                  _serverUrl = value;
                  break;
              case "authcode":
                  _authcode = value;
                  break;
              default: throw new InvalidOperationException($"{field} Value is unknown in connection settings");
          }
      }
  }
  </code></pre>
  
  <p>The problem is that this code works in all instances except when authcode has an = in it. </p>
  
  <p>So, this connection string does not give the correct details. </p>
  
  <pre><code>&lt;add name="ServerAuthCodeString" connectionString="url=https://devunifiedinterface.appstore.com; authCode=mQLw/OWghN0s4jQhBso7o68/KGsLnzwlWux2cnv5QYu=" /&gt;
  </code></pre>
  
  <p>What I am getting as output is</p>
  
  <pre><code>_authcode = mQLw/OWghN0s4jQhBso7o68/KGsLnzwlWux2cnv5QYu //Missing = at the end
  </code></pre>
  
  <p>What I need is</p>
  
  <pre><code>_authcode = mQLw/OWghN0s4jQhBso7o68/KGsLnzwlWux2cnv5QYu=
  </code></pre>
  
  <p>Yes, there is a <a href="https://stackoverflow.com/questions/4804086/is-there-any-connection-string-parser-in-c">question</a> which talks about connection strings. 
  However, the answers still do not appear to resolve the issue with the <code>=</code> sign.</p>
  
  <p>For instance, this <a href="https://stackoverflow.com/questions/4804086/is-there-any-connection-string-parser-in-c#comment56154596_15529085">comment</a> specifically talks about it. </p>
  
  <p><code>SqlConnectionStringBuilder</code> doesn't work for me. If I pass in my connectionString, it complains that keyword url is not vaid.</p>