Click here to Skip to main content
15,890,512 members
Home / Discussions / C#
   

C#

 
AnswerRe: get the stream writer of the webbrowser control Pin
Kristian Sixhøj11-Mar-10 1:47
Kristian Sixhøj11-Mar-10 1:47 
GeneralRe: get the stream writer of the webbrowser control Pin
Yustme11-Mar-10 1:48
Yustme11-Mar-10 1:48 
GeneralRe: get the stream writer of the webbrowser control Pin
Kristian Sixhøj11-Mar-10 1:51
Kristian Sixhøj11-Mar-10 1:51 
GeneralRe: get the stream writer of the webbrowser control Pin
Yustme11-Mar-10 1:57
Yustme11-Mar-10 1:57 
GeneralRe: get the stream writer of the webbrowser control Pin
Kristian Sixhøj11-Mar-10 2:04
Kristian Sixhøj11-Mar-10 2:04 
GeneralRe: get the stream writer of the webbrowser control Pin
Yustme11-Mar-10 2:13
Yustme11-Mar-10 2:13 
GeneralRe: get the stream writer of the webbrowser control Pin
Kristian Sixhøj11-Mar-10 2:25
Kristian Sixhøj11-Mar-10 2:25 
GeneralRe: get the stream writer of the webbrowser control Pin
Yustme11-Mar-10 2:33
Yustme11-Mar-10 2:33 
Getting html code of a topic in a vbulletin forum.
If you're not logged in, you're not allowed to view the topic.

I can't log in with the response class.

This was my try:
private string login(string url, string username, string password)
		{			
			string values = "vb_login_username={0}&vb_login_password={1}";
	           values += "&securitytoken=guest&cookieuser=checked&do=login";
 
			values = string.Format(values, username, password);
		
			HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);

			req.Method = "POST";
			req.ContentType = "application/x-www-form-urlencoded";
			req.ContentLength = values.Length;
			req.Timeout = 10000;

			CookieContainer a = new CookieContainer();
			req.CookieContainer = a;

			System.Net.ServicePointManager.Expect100Continue = false; // prevents 417 error

			using (StreamWriter writer = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII)) 
			{ writer.Write(values, 0, values.Length); }

			this.response = (HttpWebResponse)req.GetResponse(); 

			StringBuilder output = new StringBuilder();
 
			foreach (var cookie in response.Cookies)
			{
					output.Append(cookie.ToString());
					output.Append(";");
			}

			
		  return output.ToString();

		}  

</pre>

GeneralRe: get the stream writer of the webbrowser control Pin
Kristian Sixhøj11-Mar-10 4:22
Kristian Sixhøj11-Mar-10 4:22 
GeneralRe: get the stream writer of the webbrowser control Pin
Yustme11-Mar-10 6:41
Yustme11-Mar-10 6:41 
QuestionNeed help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes10-Mar-10 23:48
suprsnipes10-Mar-10 23:48 
AnswerRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
OriginalGriff11-Mar-10 0:11
mveOriginalGriff11-Mar-10 0:11 
AnswerRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
peropata11-Mar-10 0:21
peropata11-Mar-10 0:21 
AnswerRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Keith Barrow11-Mar-10 0:31
professionalKeith Barrow11-Mar-10 0:31 
AnswerRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 1:37
mveRichard MacCutchan11-Mar-10 1:37 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 1:48
suprsnipes11-Mar-10 1:48 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
KenKen Wong11-Mar-10 2:10
KenKen Wong11-Mar-10 2:10 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 2:19
suprsnipes11-Mar-10 2:19 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
OriginalGriff11-Mar-10 3:57
mveOriginalGriff11-Mar-10 3:57 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 2:33
mveRichard MacCutchan11-Mar-10 2:33 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 2:58
suprsnipes11-Mar-10 2:58 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Keith Barrow11-Mar-10 3:15
professionalKeith Barrow11-Mar-10 3:15 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 4:37
mveRichard MacCutchan11-Mar-10 4:37 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
suprsnipes11-Mar-10 5:13
suprsnipes11-Mar-10 5:13 
GeneralRe: Need help on how to loop through the following code to find the nearest number above in comparison to another Pin
Richard MacCutchan11-Mar-10 6:33
mveRichard MacCutchan11-Mar-10 6:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.