![]() |
|
[Tutorial] Easiest way to add a HackCommunity Login form to your application - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: Coding (https://sinister.li/Forum-Coding) +--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework) +--- Thread: [Tutorial] Easiest way to add a HackCommunity Login form to your application (/Thread-Tutorial-Easiest-way-to-add-a-HackCommunity-Login-form-to-your-application) Pages:
1
2
|
[Tutorial] Easiest way to add a HackCommunity Login form to your application - ArcaneFx - 05-26-2012 I wanted to write this tutorial for a long time now, so here goes. :thumbs: Alright, first off, add a new form to your WindowsFormsApplication and call it Login or whatever you want. Now add two textboxes and one button. The first textbox for inputting the username and the second one for the password. Change the button text to "Login". Add the following code to button1: Code: Dim postData As String = "http%3A%2F%2Fhackcommunity.com%2Fmember.php?action=login&username=" + TextBox1.Text & "&password=" + TextBox2.Text & "&submit=Login&action=do_login&url="
Dim tempcookies As New CookieContainer
Dim encoding As New UTF8Encoding
Dim byteData As Byte() = encoding.GetBytes(postData)
Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create("http://www.hackcommunity.com/member.php?action=login"), HttpWebRequest)
postreq.Method = "POST"
postreq.KeepAlive = True
postreq.CookieContainer = tempcookies
postreq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/4.0 (.NET CLR 3.5.30729"
postreq.ContentType = "application/x-www-form-urlencoded"
postreq.Referer = "http://www.hackcommunity.com/member.php?action=login"
postreq.ContentLength = byteData.Length
Dim postreqstream As Stream = postreq.GetRequestStream()
postreqstream.Write(byteData, 0, byteData.Length)
postreqstream.Close()
Dim postresponse As HttpWebResponse
postresponse = DirectCast(postreq.GetResponse, HttpWebResponse)
tempcookies.Add(postresponse.Cookies)
logincookie = tempcookies
Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
Dim thepage As String = postreqreader.ReadToEnd
If thepage.Contains("You have entered an invalid username/password combination.") = True Then
MsgBox("Error logging in, try again!", 0, "Incorrect Username/password combination.")
Else
MsgBox("Account verified, you can now proceed to the beta key generator.", 0, "Logged in.")
MAINFORM.Show()
Me.Hide()
End IfReplace the mainform with the name of your application's main form. Don't forget your imports: Code: Imports System.Net
Imports System.Text
Imports System.IOThat's basically the end of the coding part. Now click on Project Settings and change the default form to Login.vb. You're done. I just want to say thank you to the unknown user who taught me this method. Goodluck and god speed. :bye: ~ Arcane.cfg RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - Jacob - 05-26-2012 holy crap....that was amazing! RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - ArcaneFx - 05-26-2012 (05-26-2012, 03:22 AM)Jacob Wrote: holy crap....that was amazing! Haha, I know right! I just wish I could remember the guy's name. RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - bluedog.tar.gz - 05-26-2012 Nice share, thank you. RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - Shining White - 05-26-2012 This Is Very Use Ful , Thank you very Much for the Share ! RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - daovanson - 06-01-2012 (05-26-2012, 03:05 AM)Arcane.cfg Wrote: I wanted to write this tutorial for a long time now, so here goes. :thumbs:Help me , this is a error The remote server returned an error: (404) Not Found. ai line postresponse = DirectCast(postreq.GetResponse, HttpWebResponse) help me , thank RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - ArcaneFx - 06-01-2012 (06-01-2012, 05:47 PM)daovanson Wrote:(05-26-2012, 03:05 AM)Arcane.cfg Wrote: I wanted to write this tutorial for a long time now, so here goes. :thumbs:Help me , this is a error That's not an issue with the code. You were either disconnected from the internet, or HC/Whichever MyBB forum you were trying this code out on was down at the time. RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - #Swag_mybb_import6403 - 06-02-2012 That unknown user that you copied most of the code from is here: http://howtostartprogramming.com/vb-net/vb-net-tutorial-51-httpwebrequest-post-method/ His username is Eleqtriq and can be found on HF(which pops up as google apparently). RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - ArkPhaze - 06-02-2012 Just some advice, it's probably more failsafe if you check to make sure that you're logged in by seeing if such parts of the logged in member source code exist, rather than checking for that invalid password message. Check for "UserCP" or something like that and you're good. RE: [Tutorial] Easiest way to add a HackCommunity Login form to your application - daovanson - 06-03-2012 hix . help me , i can do it ![]() what is logincookie ? help me please |