Page 1 of 1

Really easy Passwordsystem

Posted: Thu Sep 08, 2011 5:45 pm
by splitedchill
Hello

In this Tutorial i show you how to make a simple Passwordsystem but the password isn't in the program it is in a PHPfile its better and secure.

Now we beginning with the PHP-File the name of my PHP-File is lizens.php

Here is the code for the PHP-File!
Code: Select all
<?php
$passwort = $_GET["passwort"];
if($passwort == "Here is your Password")
{
  echo "OK!";
}
else
{
  echo "Nein!";
}?>
This is very simple the PHP-File is looking if the password correct!


Now we come to the Code in Visualbasic in this code we send a Request to the PHP-File if the PHP-File says OK then you can Access in the Program if not the program close.

You need for this a button and a textbox the button code is this code here:

Here is the Visual Basic Code:
Code: Select all
Dim webreq As WebRequest = WebRequest.Create("YOUR Site.de/lizens.php?passwort=" & textbox1.text)
        Dim Res As Net.WebResponse = webreq.GetResponse
        Dim reader As StreamReader = New StreamReader(Res.GetResponseStream)
        Dim ok As String = reader.ReadToEnd
        
if ok = "OK!" then
form2.show()
form1.close()
else
msgbox("Password invalid")

This is very simple and not secure but its a basic Passwordsystem and no body can find the password with a reflector!

I hope you like this Tutorial and give me Feedback

Re: Really easy Passwordsystem

Posted: Thu Sep 08, 2011 7:01 pm
by Axel
You should check the hash instead of the password because its possible to capture it(with a http sniffer like fiddler)

Re: Really easy Passwordsystem

Posted: Thu Sep 08, 2011 7:24 pm
by mandai
Or better yet you could use SSL.