I got problems while trying to authenticate user using C# code on PHP forum. So far I tried:
webClient.Credentials = new NetworkCredential("Me", "MyPassword");
then:
HtmlDocument webPage = new HtmlDocument();
webPage.Load(new MemoryStream(client.DownloadData(this.websiteUri)));
I tired also adding cookie info to the WebClient header.
Moreover I tried:
using (WebClient client = new WebClient())
{
byte[] response = client.UploadValues(url, new NameValueCollection()
{
{ "usrname", "myLogin" },
{ "password", "p@ssw0rd" }
});
string result = System.Text.Encoding.UTF8.GetString(response);
}
How can I check results? Am I doing somethinng wrong? Any suggestions?
Thanks!