1 [Release | VB.NET + VB6] Computer Talks Authorization Thu Jan 20, 2011 3:20 am
The Professor
Contributor
Alright, I know I'm going a little overboard with these type of scripts, but most of you are more familiar with VB than you are with AutoIt. So I made an authorization script in VB6 + VB.NET. For those of you who are fairly new to Visual Basic the best option would be to download the .zip file, but those of you who have fairly enough experience to implement this code without downloading any files, the source code will be included in this post.
VB6 Download: [You must be registered and logged in to see this link.]
VB6 Source Code:
VB8 / VB.NET Source Code:
Requirements (Both):
Form; don't change name from the default.
Two TextBoxes; don't change name from the default.
Button; don't change name from the default.
I think this is pretty deserving of +rep, but I'll let you decide.
As a side note, the VB6 version of the authorization will be posted ASAP.
VB6 Download: [You must be registered and logged in to see this link.]
VB6 Source Code:
- Code:
Private Sub Command1_Click()
Dim oHTTP As winhttp.WinHttpRequest
Set oHTTP = New winhttp.WinHttpRequest
oHTTP.Open "GET", "http://www.computalks.com/login?" & "username=" & Text1.Text & "&password=" & Text2.Text & "&login=Log+in", False
oHTTP.Send
If InStr(oHTTP.ResponseText, "Welcome") Then
Text1.Text = ""
Text2.Text = ""
MsgBox ("Login Sucessful!")
' Secondary Functionality Here...
Else
Text1.Text = ""
Text2.Text = ""
MsgBox ("Login Unsucessful! Invalid User Info.")
' Secondary Consequencial Functionality Here..
End If
End Sub
VB8 / VB.NET Source Code:
- Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oHTTP As WinHttp.WinHttpRequest
oHTTP = CreateObject("WinHttp.WinHttpRequest.5.1")
oHTTP.Open("GET", "http://www.computalks.com/login?" & "username=" & TextBox1.Text & "&password=" & TextBox2.Text & "&login=Log+in", False)
oHTTP.Send()
If InStr(oHTTP.ResponseText(), "Welcome") Then
TextBox1.Text = ""
TextBox2.Text = ""
'Secondary Actions / Main Functionality Here...
MsgBox("Success! User has been successfully authenicated!")
Else
TextBox1.Text = ""
TextBox2.Text = ""
MsgBox("Failure! User data invalid!")
'Secondary Consequencial Functionality Here...
End If
End Sub
End Class
Requirements (Both):
Form; don't change name from the default.
Two TextBoxes; don't change name from the default.
Button; don't change name from the default.
I think this is pretty deserving of +rep, but I'll let you decide.