rfazendeiro
Centurion
- Joined
- Mar 8, 2004
- Messages
- 110
Hi to all,
im trying to send logon information via GET to a website., but i'm having some problems. I'm using 1.1 with vs2003. This is the code i have right now
The error message i get is this
does anyone have any ideia how to resolve this?
thx in advance
im trying to send logon information via GET to a website., but i'm having some problems. I'm using 1.1 with vs2003. This is the code i have right now
C#:
string sUrl;
HttpWebRequest oRequest;
CookieContainer oCookieContainer;
HttpWebResponse oResponse;
Stream oStream;
StreamReader oStreamReader;
string responseFromServer;
sUrl = "https://hotspot.ptwifi.pt/user?lg=pt&username=XXXXXXX&password=YYYYYYY";
//sUrl = "http://www.google.com";
oRequest = (HttpWebRequest)(WebRequest.Create(sUrl));
oRequest.Method = "GET";
oCookieContainer = new CookieContainer();
oRequest.CookieContainer = oCookieContainer; //this allows the cookies sent '\b' to be loaded;
oResponse = (HttpWebResponse)(oRequest.GetResponse());
oStream = oResponse.GetResponseStream();
oStreamReader = new StreamReader(oStream);
responseFromServer = oStreamReader.ReadToEnd();
Console.WriteLine (responseFromServer);//i use the result here
Console.ReadLine();
The error message i get is this
Code:
System.Net.WebException: The underlying connection was closed: Could not establish trust relationship with remote server.
at System.Net.HttpWebRequest.CheckFinalStatus()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetResponse()
at ConsoleApplication1.Class1.Main(String[] args) in c:\documents and settings\rfazendeiro\my documents\visual studio projects\consoleapplication1\class1.cs:line 35
does anyone have any ideia how to resolve this?
thx in advance