1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[VB.net] Basic login

Discussion in 'Code Snippets and Tutorials' started by Andromeda, Aug 19, 2009.

  1. Andromeda

    Andromeda Level I

    Joined:
    Aug 19, 2009
    Messages:
    44
    Likes Received:
    4
    Code (Text):
    1.  
    2.     Public Function NeoLogin(ByVal Username As String, ByVal Password As String) As Boolean
    3.  
    4.         Dim Client As New System.Net.WebClient
    5.         Dim Page As String = Client.DownloadString("http://www.neopets.com/login.phtml?username=" & Username & "&password=" & Password & "&destination=%2Fpetcentral.phtml")
    6.  
    7.         If InStr(Page, "Welcome to Pet Central") Then
    8.             Return True
    9.         Else
    10.             Return False
    11.         End If
    12.  
    13.     End Function
    14.  
    Returns true if the login is successful, or false if it isn't. Since this is a basic function, it has the same limits that the site has for login attempts and doesn't handle errors. Feel free to improve on it.