Hack Forums
[.NET] [Source] Login/Register Application [Source] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [Source] Login/Register Application [Source] (/showthread.php?tid=1757572)

Pages: Pages 1 2


[Source] Login/Register Application [Source] - Androcir - Sep 24, 2011

So yeah, today i finished a, kinda 2 hours project.

So here's a showoff xD





Features
So what this does, as the title says, it logs in to something that you want, and it registers to that samething...

This applications uses a uploaded textfile to get and check if the username/password is right. In order to do this you need to upload a php file, that will write/create the textfile in the same domain.

Source of The program

Login Form

Code
Imports System.Net
Imports System.IO
Public Class Form1
    Dim wc As New Net.WebClient
    Dim texting = wc.DownloadString("<yourdomainhere>/data.txt")
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  Form2.Show()
  Form2.TextBox1.Text = Me.TextBox1.Text
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

  If TextBox1.Text = Nothing Or TextBox2.Text = Nothing Or TextBox1.Text = Nothing And TextBox2.Text = Nothing Then
    MessageBox.Show("Please specify both username and password")
  ElseIf texting.contains(TextBox1.Text & ":" & TextBox2.Text) Then
    MessageBox.Show("you're loged in")
  ElseIf Not texting.contains(TextBox1.Text & ":" & TextBox2.Text) Then
    MessageBox.Show("Invalid login information")
  End If

    End Sub
End Class

Register Form

Code
Imports System.Net
Public Class Form2

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  Button2.Enabled = False
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

  Dim request As WebRequest = WebRequest.Create("<yourdomainhere>/post.php?w=" & TextBox1.Text & ":" & TextBox2.Text)

  request.GetResponse()
  MessageBox.Show("You have been successfully Registered, please restart the application to login", "Notification")
  Button2.Enabled = True
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  Process.Start(Application.ExecutablePath)
  Me.Close()
  Form1.Close()
    End Sub
End Class

PHP File

Code
<?php
$msg = $_GET['w'];
$logfile= 'data.txt';
$fp = fopen($logfile, "a");
fwrite($fp, $msg);
fclose($fp);
?>

If you're going to useit, leave a thanks =)

Special Thanks
Ac!d!c.
Вanksy
Antti



* - Submariner - Sep 24, 2011

(Sep 24, 2011 12:07 PM)Androcir Wrote:  well good for you mate, it just demonstrates that you already had the knowledge, unlike me.

Fuck haters. they gonna hate forever.

Good Job , keep it up , I will take your source and i will try to make something more advanced :)
thanks again for the great share.


* - Androcir - Sep 30, 2011

(Sep 24, 2011 12:14 PM)Cyb3rSnake Wrote:  Fuck haters. they gonna hate forever.

Good Job , keep it up , I will take your source and i will try to make something more advanced :)
thanks again for the great share.

No, thank you!
And good luck with your project ;)


* - Blizzard - Sep 30, 2011

Its easy to code an application like this.

Anyway it will help some new members out there, Good job

-Blizz


* - Shenron - Sep 30, 2011

This is not working. Login is form1 Register form2, when i debug, it opens register, and after successful registration, when you click restart, it just opens register again..

excuse me if im doing something wrong, but thats what happens to me :/


* - Sol Yurick - Sep 30, 2011

Hello,

Unfortunately I have found some LQP, Off-Topic or Flaming posts. I did infact have to remove them because they all fall under breaking HF rules. If you have any questions feel free to PM me.

We also recommend you take the time to read the HF Help Documents section. The answer to your questions should be contained in there.

Thank you,
Astonish is NJ



* - United Kingdom - Sep 30, 2011

I might use this wana help me
:P

thanks


* - Androcir - Sep 30, 2011

(Sep 30, 2011 04:53 AM)ipwn00bs Wrote:  This is not working. Login is form1 Register form2, when i debug, it opens register, and after successful registration, when you click restart, it just opens register again..

excuse me if im doing something wrong, but thats what happens to me :/

Well, pm me the your code, and i'll see if i can help. Cuz the code i postyed works just fine =)

(Sep 30, 2011 03:43 AM)BlizzaЯd™ Wrote:  Its easy to code an application like this.

Anyway it will help some new members out there, Good job

-Blizz

Yeah, it is really easy to code... i did this because some people ask for it and since i was a little too bored...
Thanks ;D


* - Stenography - Sep 30, 2011

Looks good,
Thanks alot of sharing.

But how can I do such a thing:
I will approve the registration (He registers and I approve him..)


* - Androcir - Sep 30, 2011

(Sep 30, 2011 10:50 AM)PolarX Wrote:  Looks good,
Thanks alot of sharing.

But how can I do such a thing:
I will approve the registration (He registers and I approve him..)

That i still don't know how to do it. But i kinda thought about it..


* - Shenron - Sep 30, 2011

for approval, you could do something like the register writes to another text file, and you have to copy the registered members from that text file to another text file that the login form reads from. just a simple proposal

and dw, i must have been doing something wrong before :S
it works now.
but i think the php file might need to be rewritten.
if i register 2 accounts, it will save to the text file as something like this
fred:123hello:good
fred and hello being 2 different accounts and 123 and good the passwords
the login obviously has trouble reading this..

edit:
you should add something after successful login to make it go to the hidden page, just incase the biggest n00bs (not quite me) dont know to do that
PHP Code

<?php 
If TextBox1.Text = Nothing Or TextBox2.Text = Nothing Or TextBox1.Text = Nothing And TextBox2.Text = Nothing Then
    MessageBox
.Show("type password and username...")
  ElseIf 
texting.contains(TextBox1.Text & ":" & TextBox2.Text) Then
    MessageBox
.Show("Your logged in")
    
Me.Hide()
    
Form3.Show() 



* - Androcir - Sep 30, 2011

(Sep 30, 2011 01:20 PM)ipwn00bs Wrote:  for approval, you could do something like the register writes to another text file, and you have to copy the registered members from that text file to another text file that the login form reads from. just a simple proposal

and dw, i must have been doing something wrong before :S
it works now.
but i think the php file might need to be rewritten.
if i register 2 accounts, it will save to the text file as something like this
fred:123hello:good
fred and hello being 2 different accounts and 123 and good the passwords
the login obviously has trouble reading this..

edit:
you should add something after successful login to make it go to the hidden page, just incase the biggest n00bs (not quite me) dont know to do that
PHP Code

<?php 
If TextBox1.Text = Nothing Or TextBox2.Text = Nothing Or TextBox1.Text = Nothing And TextBox2.Text = Nothing Then
    MessageBox
.Show("type password and username...")
  ElseIf 
texting.contains(TextBox1.Text & ":" & TextBox2.Text) Then
    MessageBox
.Show("Your logged in")
    
Me.Hide()
    
Form3.Show() 

I'll work on the php, and the approval thingy, thanks for the feedback mate =)




* - xNoNamez - Sep 30, 2011

Awesome share with the community thankyou so much !


* - Androcir - Oct 1, 2011

(Sep 30, 2011 04:39 PM)xNoNamez Wrote:  Awesome share with the community thankyou so much !

No problem dude.
And thank you for the feedback =)


* - SergeMorel - Oct 1, 2011

Basic & stays good.
Altough, someone can screw your ftp really hard if they know the .php file which is not hard to get.