Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Web-Designer's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Arizona, USA
    Posts
    270
    Reputation
    11
    Thanks
    53
    My Mood
    Fine

    Question [Help]Login System

    from what I see and looked up. . .this should work! I have the txt file on there, which right now the it should be:

    Username: TestAccount
    Password: Test123

    But doesn't work. . .I just want to be able to add people as I want. . .with-out them having to redownload it.
    Code:
    Public Class Login
            Dim Accepted = 2
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
            On Error GoTo ERRORCODE1
            Dim WebCache As String
            Dim Usernameconfig
            Dim Result
            Usernameconfig = TextBox1.Text.Replace(" ", "%20")
            WebCache = "https://fishy-designs.******.com/Users" + Usernameconfig + ".txt"
            Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create(WebCache)
            Dim response As System.Net.HttpWebResponse = request.GetResponse()
            Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream(), System.Text.Encoding.GetEncoding("windows-1252"))
            Result = sr.ReadToEnd()
            If TextBox2.Text = Result Then
                Call AcceptedSub()
                Accepted = 1
            End If
    ERRORCODE1: If Accepted = 1 Then : Else : MsgBox("Invalid Username or Password") : End If
            Accepted = 2
        End Sub
            Private Sub AcceptedSub()
            Form1.Show()
        End Sub
    End Class
    Last edited by Web-Designer; 09-15-2010 at 02:17 AM.

  2. #2
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead

  3. #3
    Sydney's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Location
    Germany...
    Posts
    1,356
    Reputation
    37
    Thanks
    1,144
    My Mood
    Amused
    Cant u just use
    If Textbox1.Text = "Username" and TextBox2.Text = "Password" then

    Else
    End if

    Or do you want that you can change the Datas for the Programm every time...Like a ViP Programm ?

    Thanks Cosmos


  4. #4
    Web-Designer's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Arizona, USA
    Posts
    270
    Reputation
    11
    Thanks
    53
    My Mood
    Fine
    Xscapism, READ THE POST! OMG sorry just like wtf why post if it doesn't even go with what I ask?


    Quote Originally Posted by kongamonga View Post
    Cant u just use
    If Textbox1.Text = "Username" and TextBox2.Text = "Password" then

    Else
    End if

    Or do you want that you can change the Datas for the Programm every time...Like a ViP Program ?
    I'm using the program for a few people, but I also want to be able to add people as I want. With-out them having to re-download it. . .So the code you put won't work how I want. So yeah. . .
    Last edited by Web-Designer; 09-15-2010 at 11:41 PM.
    Code:
    Looking for some project(s) to dedicate my time to! I know HTML, PHP, MySQL and JavaScript.
    
    
    - Message me if I can help you with something, all I want is some credit!

  5. #5
    Imported's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    142
    Reputation
    27
    Thanks
    47
    My Mood
    Relaxed
    Quote Originally Posted by Web-Designer View Post

    Xscapism, READ THE POST! OMG sorry just like wtf why post if it doesn't even go with what I ask?




    I'm using the program for a few people, but I also want to be able to add people as I want. With-out them having to re-download it. . .So the code you put won't work how I want. So yeah. . .
    Hmm why not just when a new person registers their usename and password you add it to a txt file on the internet, in a format like this

    [php]
    <username>j-Deezy</username><password>NiceTry</password>
    [/php]

    And on login just use a web request to download the "user list" text file and do a simple text compare and see if the username/password matches or not. You don't even have to save the txtfile to the computer as you can directly read the response stream with StreamReader.

    If you need more help than that just ask


    Quote Originally Posted by Web-Designer View Post

    Xscapism, READ THE POST! OMG sorry just like wtf why post if it doesn't even go with what I ask?




    I'm using the program for a few people, but I also want to be able to add people as I want. With-out them having to re-download it. . .So the code you put won't work how I want. So yeah. . .
    Hmm why not just when a new person registers their usename and password you add it to a txt file on the internet, in a format like this

    [php]
    <username>j-Deezy</username><password>NiceTry</password>
    [/php]

    And on login just use a web request to download the "user list" text file and do a simple text compare and see if the username/password matches or not. You don't even have to save the txtfile to the computer as you can directly read the response stream with StreamReader.

    If you need more help than that just ask
    Last edited by Imported; 09-16-2010 at 01:06 AM.
    TROLOLOLOLO


  6. #6
    Web-Designer's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Arizona, USA
    Posts
    270
    Reputation
    11
    Thanks
    53
    My Mood
    Fine
    First I actually don't want people to be able to sign up. I want to be able to add people as I wish not people sign up as they wish. But like people able to sign up on the web would work, where I give out the link to only people I want to sign up

    How hard is it to make a MySQL user data base for me to use with my programs? I'm using 000Webhos*****m right now which is 100GB Bandwidth and 1.5GB storage and you can use MySQL on there, so it says. . .would I be able to do that? I have no [EDIT] Idea where to start with MySQL, I have no experience with it at all. . .I'm scare I'll f*ck something up and it'll like eat me or something xD lol

    I know bubbles is like the best one around here with databases. . .Maybe he could do a tut or some thing about how to make one, and hook it up with your program(s) ^.^? Or jsut tell/teach me as long as I learn it one way or another

    (Well till then I'm now obsessive refreashing this page and Google-ing "How-To -", why? because its 3:21 AM witching hour and I think everything I'm told is real. . .lol)


    thanks peoplez () for the help, on more then just this post

  7. #7
    Imported's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    142
    Reputation
    27
    Thanks
    47
    My Mood
    Relaxed
    Quote Originally Posted by Web-Designer View Post
    First I actually don't want people to be able to sign up. I want to be able to add people as I wish not people sign up as they wish. But like people able to sign up on the web would work, where I give out the link to only people I want to sign up

    How hard is it to make a MySQL user data base for me to use with my programs? I'm using 000Webhos*****m right now which is 100GB Bandwidth and 1.5GB storage and you can use MySQL on there, so it says. . .would I be able to do that? I have no [EDIT] Idea where to start with MySQL, I have no experience with it at all. . .I'm scare I'll f*ck something up and it'll like eat me or something xD lol

    I know bubbles is like the best one around here with databases. . .Maybe he could do a tut or some thing about how to make one, and hook it up with your program(s) ^.^? Or jsut tell/teach me as long as I learn it one way or another

    (Well till then I'm now obsessive refreashing this page and Google-ing "How-To -", why? because its 3:21 AM witching hour and I think everything I'm told is real. . .lol)


    thanks peoplez () for the help, on more then just this post
    Bubbles, LOL. I'm going to give him shit for that one.

    While MySQL would be the most suitable way of doing this, it CAN just be achieved with a simple text file that only you can edit. You can use 000webhost to store a txt file with all the users YOU want and their respective passwords on there. When someone attempts to log in it quickly downloads the stream, checks whether the entered username/pass matches any in the file and if so, log in.
    TROLOLOLOLO


  8. #8
    Web-Designer's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Arizona, USA
    Posts
    270
    Reputation
    11
    Thanks
    53
    My Mood
    Fine
    yeah bubbles, thats just what came to mind lol I know its not really his name just yeah how I remember it lol so correction so Blubb1337 doesn't like hack me and cyber-ly kick my as* for calling him that lol Blubb1337 or Blubb NOT Bubbles (lol)

    And okay that sounds good, but how would I code that? Don't forget I'm only like 3weeks of experience into any programing besides HTML so yeah lol
    Last edited by Web-Designer; 09-16-2010 at 04:43 AM.
    Code:
    Looking for some project(s) to dedicate my time to! I know HTML, PHP, MySQL and JavaScript.
    
    
    - Message me if I can help you with something, all I want is some credit!

  9. #9
    Imported's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    142
    Reputation
    27
    Thanks
    47
    My Mood
    Relaxed
    EDIT: One second, I fucked up
    Last edited by Imported; 09-16-2010 at 05:04 AM.
    TROLOLOLOLO


  10. #10
    Web-Designer's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    Arizona, USA
    Posts
    270
    Reputation
    11
    Thanks
    53
    My Mood
    Fine
    Okay lol and I just refreshed cause it logged me out so now I gotta wait. . .as long as its worth waiting for. . .lol

    btw: "Between the do/loop". . .you might wanna use another word or somsthing. . .lol
    Code:
    Looking for some project(s) to dedicate my time to! I know HTML, PHP, MySQL and JavaScript.
    
    
    - Message me if I can help you with something, all I want is some credit!

  11. #11
    Imported's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Posts
    142
    Reputation
    27
    Thanks
    47
    My Mood
    Relaxed
    Quote Originally Posted by Web-Designer View Post
    yeah bubbles, thats just what came to mind lol I know its not really his name just yeah how I remember it lol

    And okay that sounds good, but how would I code that? Don't forget I'm only like 3weeks of experience into any programing besides HTML so yeah lol
    Firs things first. Don't user 000webhost after all. I forgot it's like uber tempermental with txtfiles. Use ******** instead it's easy enough to use to upload files.

    Okay, well I'm not going to absolutely spoonfeed you (I doubt you need to be spoonfed totally) but yeah I'll point you in the right direction.

    Okay with your textfile you write it out in like notepad or something first, make it a layout that's consistent such as
    [php]
    <username>HELLO</username><password>LOLOL</password>
    [/php]
    Something with consistent separators i.e <username></username> etc.

    Now you upload that to your ftp site using a FTP uploader or w/e they're called. Nice, that's the list side of things done.

    Now all you need to do is when a user presses "Login" to quickly get the stream and read it and see if you find the username there at all.

    I'll give you a hint; Create a webclient and use intellisense...you're looking for string, remember

    Also, you can't use StreamReader for this but I hear that "StringReader" works a treat
    [php]
    Dim txt As String = wc.DownloadString("https://******.********.com/resources/Login.txt")

    Using sRead As New IO.StringReader(txt)
    Do
    If LINEVARIABLE is nothing then Exit Do
    Loop
    End Using
    [/php]

    In between the do/loop you're going to need to extract the username and the password. Check the snippets vault or write your own "ReadBetween" function to get the parts between "<username></username>" etc. Basically you first wanna loop through the lines until the end and check if any usernames on the list are what the user put into the textbox, if not well you can just exit with an error message (I recommend making this whole section a seperate boolean function) and if it does find the username, get the password from that line (be sure it's the same line as the username )

    That should be all?
    TROLOLOLOLO


  12. The Following User Says Thank You to Imported For This Useful Post:

    Web-Designer (09-18-2010)

  13. #12
    Erinador's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Posts
    224
    Reputation
    14
    Thanks
    111
    My Mood
    Bored
    What imported posted above will work, but instead of using <username></username>

    use something like:

    [php]
    txtfile contents:
    username1;password1
    username2;password2
    username3;password3

    code to seperate password from username:

    Dim txt As String = wc.DownloadString("https://******.********.com/resources/Login.txt")

    Using sRead As New IO.StringReader(txt)
    Dim LINEVARIABLE as String
    Dim SeperateWords() as String
    Do
    LINEVARIABLE = sRead.ReadLine()
    If LINEVARIABLE is nothing then Exit Do
    SeperateWords() = Split(LINEVARIABLE,";")
    'Now SeperateWords() Contains:
    'SeperateWords(0) = "username1"
    'SeperateWords(1) = "password1"
    Loop
    End Using

    [/php]

    ";" can be replaced with anything else, but make sure you use a character that can't be used on either password or username
    Last edited by Erinador; 09-17-2010 at 09:12 AM.

  14. #13
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    Quote Originally Posted by Erinador View Post
    What imported posted above will work, but instead of using <username></username>

    use something like:

    [php]
    txtfile contents:
    username1;password1
    username2;password2
    username3;password3

    code to seperate password from username:

    Dim txt As String = wc.DownloadString("https://******.********.com/resources/Login.txt")

    Using sRead As New IO.StringReader(txt)
    Dim LINEVARIABLE as String
    Dim SeperateWords() as String
    Do
    LINEVARIABLE = sRead.ReadLine()
    If LINEVARIABLE is nothing then Exit Do
    SeperateWords() = Split(LINEVARIABLE,";")
    'Now SeperateWords() Contains:
    'SeperateWords(0) = "username1"
    'SeperateWords(1) = "password1"
    Loop
    End Using

    [/php]
    Meh I didn't want to introduce splitting as he's new and headers make things much cleaner IMO. having

    Code:
    Info1;Info2
    While it works if you split it, it doesn't contain too much info on the subject. I guess it doesn't really have to as the program doesn't give two shits what you contain it in, but I prefer the structure of mine. It's just an opinion, your method is equally good, if not better. (Probably is more efficient as you only need to split, rather than getbetween) But whatever floats your boat, really.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  15. #14
    Blubb1337's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Germany
    Posts
    5,915
    Reputation
    161
    Thanks
    3,108
    Side Note: 95% of free webhost don't allow to externally connect to their MySQL databases. You can only connect locally via php scripts on that webhost -> useless with a free webhost. I could sure offer you a MySQL DB with external access, but if it's just this simple login system, go for the textfile thingy above.

    And please, encrypt the passwords using md5.

    [php]Imports System.Security.Cryptography
    Imports System.Text

    Public Function MD5StringHash(ByVal strString As String) As String
    Dim MD5 As New MD5CryptoServiceProvider
    Dim Data As Byte()
    Dim Result As Byte()
    Dim Res As String = ""
    Dim Tmp As String = ""

    Data = Encoding.ASCII.GetBytes(strString)
    Result = MD5.ComputeHash(Data)
    For i As Integer = 0 To Result.Length - 1
    Tmp = Hex(Result(i))
    If Len(Tmp) = 1 Then Tmp = "0" & Tmp
    Res += Tmp
    Next
    Return Res
    End Function[/php]

    [php]If MD5StringHash(SeperateWords(1)) = MD5StringHash(txtPassword.text) then

    [...][/php]



  16. The Following User Says Thank You to Blubb1337 For This Useful Post:

    Web-Designer (09-18-2010)

  17. #15
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    That's why you get payed web servers or dedicated servers...

    On that note, I don't remember doing this for someone , somewhere on here....


     


     


     



    The Most complete application MPGH will ever offer - 68%




Page 1 of 2 12 LastLast

Similar Threads

  1. [Help] login system that connects to a MYSQL database
    By justiman in forum Visual Basic Programming
    Replies: 4
    Last Post: 04-12-2011, 10:40 AM
  2. [Help] Login System [/Closed]
    By LeonRus in forum Visual Basic Programming
    Replies: 7
    Last Post: 03-10-2011, 07:26 PM
  3. [Help] Login System
    By omanel in forum Web Languages
    Replies: 1
    Last Post: 02-05-2011, 10:11 AM
  4. [Help]Login System Code Fail
    By Sydney in forum Visual Basic Programming
    Replies: 6
    Last Post: 09-03-2010, 07:47 AM