Register for your free account! | Forgot your password?

You last visited: Today at 12:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Answer

Discussion on Answer within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2010
Posts: 70
Received Thanks: 9
Answer

I'm coding a program and i want make a login whit this forum using HttWebRequest. It's possible made this?Someone can help me pls?
Thx
Pippo
pippo2040 is offline  
Old 08/04/2012, 15:56   #2
 
elite*gold: 14
The Black Market: 108/0/1
Join Date: May 2011
Posts: 2,671
Received Thanks: 818
Yes, it's possible.
You could use a firefox addon like "Live HTTP Headers" to get the post-data you have to send.
vwap is offline  
Old 08/05/2012, 15:07   #3
 
elite*gold: 0
Join Date: Dec 2010
Posts: 70
Received Thanks: 9
Code:
static string login(string url, string username, String password)
        {      
            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
            string cookie = "";
            string values = "vb_login_username=" + username + "&vb_login_password=" + password
                                + "securitytoken=guest&"
                                + "cookieuser=checked&"
                                + "do=login";
            req.Method = "POST";
            req.ContentType = "application/x-www-form-urlencoded";
            req.ContentLength = values.Length;
            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); }

            HttpWebResponse c = (HttpWebResponse)req.GetResponse();
            foreach (Cookie cook in c.Cookies) { cookie = cookie + cook.ToString() + ";"; }

            return cookie;
        }
where I'm doing wrong?
I don't know if it connects or not
pippo2040 is offline  
Reply


Similar Threads Similar Threads
ANSWER PLS
03/31/2011 - Grand Chase - 2 Replies
Is there a hack for GCPH for now? no offense just asking and give me an update pls...
[REQ] I have a answer
03/23/2011 - General Gaming Discussion - 3 Replies
Hello,today i was thinking: "Is possibile decrease level for sending parcels"? yeah that my answer,i need to decrease the level for sending parcels,i really need it,Is possibile making that?thanks for replye's.
YES or NO answer
10/19/2009 - Metin2 Private Server - 17 Replies
Is it possible run a Metin2 Server Whitout Virtual PC Microsoft or any VHD file? Ty cumpz
!does any one know the answer??? plz look
07/19/2008 - Dekaron - 9 Replies
why wont the revolution 8.3 uce or the sora uce find the dekaron.exe plz help me
Hello:need answer plz
02/19/2008 - Silkroad Online - 1 Replies
what the private server help for ??



All times are GMT +1. The time now is 12:08.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.