title: How to pass variables from C# Windows Form Application to PHP Web-Service
body: <p>I have been battling a few days to pass variables from C# Windows Form Application to a PHP Web-Service. After numerous tests I concluded that the variables from the Windows Form Application does not reach the PHP Web-Service.</p>
  
  <p>It seems like my method of passing variable is not correct. </p>
  
  <p>A bit of background on the variables:
  When the user login to the Windows Form Application, the username, password and a unique software token is send to the Web-Service for validation from my database. </p>
  
  <p>I suspect my problem is in the way I structure the URL.</p>
  
  <p>Here is my C# Code:</p>
  
  <pre><code>var Token = "Token Number";
  var username = txtusername.Text;
  var password = txtpassword.Text;
  
          try
          {
              WebRequest request = WebRequest.Create("https://mydomain.com.au/LoginVerification.php?username=username&amp;password=password&amp;Token=Token");
              request.Method = "GET";
              WebResponse response = request.GetResponse();
              Stream dataStream = response.GetResponseStream();
              // Open the stream using a StreamReader for easy access.  
              StreamReader reader = new StreamReader(dataStream);
              // Read the content.  
              var responseFromServer = reader.ReadToEnd();
              MessageBox.Show(responseFromServer.ToString());
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.ToString());
          }
  </code></pre>