Minecraft Vb.net Login Open Source
This is an Minecraft Login Function to check the account information!
Source Code
Code:
Public Function GetAccountStatus(ByVal Username As String, ByVal password As String)
Dim status As String = "wrong,unknown"
Dim bContent As Byte() = Encoding.ASCII.GetBytes("user=" & Username & "&password=" & password & "&version=12")
Dim webReq As HttpWebRequest = HttpWebRequest.Create(New Uri("http://www.minecraft.net/game/getversion.jsp"))
webReq.ContentType = "application/x-www-form-urlencoded"
webReq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; sl; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
webReq.Method = "POST"
Dim ReqStream As IO.Stream = webReq.GetRequestStream()
ReqStream.Write(bContent, 0, bContent.Length)
ReqStream.Close()
Dim webRes As HttpWebResponse = webReq.GetResponse()
Dim ResStream As IO.StreamReader = New IO.StreamReader(webRes.GetResponseStream())
Dim strResponse As String = ResStream.ReadToEnd()
'Web Response Text
'-------------------------
'Wrong User = Bad Login
'Wrong Password = Bad Login
'No User &/Or Password = Bad Login
'Wrong Version(version=) = Wrong Version
'Done = NUMBERS(acc index):LOGINNAME:NUMBERS(cookie value):NUMBERS(cookie value)
If strResponse.Contains("Bad login") Then
status = "wrong,accountinfo"
Return status
End If
If strResponse.Contains(":") Then
status = "works,done"
Return status
End If
'Made by i33z
'Dont Remove Creditz Please ^^
'fear.v2games.de
Return status
End Function
Anwendung
Code:
GetAccountStatus("USERNAME", "PASSWORD")
The function returning a string
"works,done" if the account works fine
"wrong,accountinfo" if the account not works
Questions ? Just ask
!