Hi
I am trying to connect and get a WebResponse of a CONNECTED user.
For that, I should first connect to the webSite, but I can figure out how.
I already read like 20 pages about cookies and stuff and still cant understand this stuff.
The site im trying to connect is http://www.esl.eu/ - http://www.esl.eu/login
Here is my code
public static string getString(string link)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(link);
// Set credentials to use for this request.
CredentialCache cache = new CredentialCache();
//?? cache.Add(new Cookie(
request.CookieContainer = cache;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
// Get the stream associated with the response.
Stream receiveStream = response.GetResponseStream();
// Pipes the stream to a higher level stream reader with the required encoding format.
StreamReader readStream = new StreamReader(receiveStream, Encoding.UTF8);
response.Close();
readStream.Close();
return readStream.ReadToEnd();
}