vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   C# login into a vbulletin forum (https://vborg.vbsupport.ru/showthread.php?t=237396)

Jeweetog 03-03-2010 04:04 PM

C# login into a vbulletin forum
 
Hi,

How can I log into a vb forum with C#?

Thanks in advance!

Speysider 03-03-2010 04:50 PM

What?
Don't understand your request.

If I read correctly, you want to login to a vb forum with your customer number. Just to let you know, your customer number works ONLY on vBulletin.com, NOWHERE ELSE.

Jeweetog 03-03-2010 05:09 PM

No just log in to a vbulletin forum. For exmaple, my own forum on my own website, with the language C#.

Desktop application

Speysider 03-03-2010 05:18 PM

Your question is best suited for the vb3 programming section on vb.org.

Jeweetog 03-03-2010 05:26 PM

See if i can ask a mod to replace it!

--------------- Added [DATE]1267729324[/DATE] at [TIME]1267729324[/TIME] ---------------

I found this code, after executing it in debug mode. The username can't be found in the content of the page:

[CODE=]
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);
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); }

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

StringBuilder output = new StringBuilder();

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


return output.ToString();
}[/CODE]


What is it missing?


All times are GMT. The time now is 02:42 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01370 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete