login not working
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: login not working

  1. #1
    Join Date
    Jan 2011
    Posts
    3

    login not working

    hi
    i was wondering if anyone can help me with my code what im trying to do is get this code to login to the steamcommunity website but am having a problem with the login packet any ideas on this would be great thanks...


    Form Code:
    Private Sub Command1_Click()
    Socket.Connect "steamcommunityDOTcom", "80"
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    End
    End Sub

    Private Sub Socket_Connect()
    SteamLogin Text1.Text, Text2.Text, Socket
    End Sub

    Private Sub Socket_DataArrival(ByVal bytesTotal As Long)

    Dim THEDATA As String * 18

    Socket.GetData THEDATA

    If THEDATA = "HTTP/1.1 302 Found" Then
    MsgBox "Correct Password!", vbInformation

    Else
    MsgBox "Wrong Password!", vbCritical
    End If

    Socket.Close
    End Sub

    Module Code:
    Public Function SteamLogin(Username As String, Password As String, Winsck As Winsock)

    Dim LOGINPACKET As String, FINALLEN As String

    FINALLEN = 36 + Len(Username) + Len(Password)

    LOGINPACKET = "POST /loginForm HTTP/1.1" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Host: " & Winsck.RemoteHost & vbCrLf
    LOGINPACKET = LOGINPACKET + "User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.8) Gecko/20050511 Firefox/1.0.4" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Accept-Language: en-gb,en;q=0.5" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Accept -Encoding: gzip , deflate" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Keep-Alive: 300" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Connection: keep -alive" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Referer: http://wwwDOTgoogleDOTcom" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Content-Type: application/x-www-form-urlencoded" & vbCrLf
    LOGINPACKET = LOGINPACKET + "Content-Length: " & FINALLEN & vbCrLf & vbCrLf

    LOGINPACKET = LOGINPACKET + "steamAccountName=" & Username & "&steamPassword=" & Password & "&userlogin=Log+In"

    Winsck.SendData LOGINPACKET

    End Function

  2. #2
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,999

    Re: login not working

    They probably don't ALLOW remote login. It's not allowed here (AUP).

    Plus, whatever you do to make it work will cause them to change it when they discover you have logged in. Most add a CAPTCHA
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Jan 2011
    Posts
    3

    Re: login not working

    hi
    i forgot to post the login source for steamcommunity website sorry

    Code:
    <form enctype="multipart/form-data" action="https://steamcommunity.com/" method="POST" name="loginForm" id="loginForm">
    				<input type="hidden" name="action" value="doLogin" />
    				<input type="hidden" name="goto" value="" />
    				<input type="hidden" name="qs" value="" />
    
    				<input type="hidden" name="msg" value="" />
    				<label for="steamAccountName">Steam Username:</label>
    				<input class="textField" type="text" name="steamAccountName" id="steamAccountName" maxlength="64" /><br />
    				<label for="steamPassword">Password:</label>
    				<input class="textField" type="password" name="steamPassword" id="steamPassword" autocomplete="off" maxlength="64" /><br />
    								<input class="subImage" type="image" id="imageLogin" onMouseover="iSwap('imageLogin','skin_1/buttonLoginOver.gif')" onMouseout="iSwap('imageLogin','skin_1/buttonLogin.gif')" src="https://steamcommunity.com/public/images/skin_1/buttonLogin.gif" width="104" height="25" border="0"/>
    				</form>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center