VB.net Please Help!!

 
Post new topic   Reply to topic    The Glitch Society Forum Index -> Off-Topic -> Anything
View previous topic :: View next topic  
Author Message
Redeemer




Joined: 08 Jul 2004
Posts: 38
Location: NYC

PostPosted: Mon Sep 26, 2005 12:55 am    Post subject: VB.net Please Help!! Reply with quote

hey im creating a windows app with allows the user to enter name and password which will be authenticated. Im 98% complete but no matter what i still get access denied. Mad Can any of you programmers help me out?? Crying or Very sad
Im using visual studio.net 2003


This is the module part:



Module modLogin
Public bool As Boolean
Dim UsernameDatabase() As String = {"joe", "angel", "sam", "mary", "nancy"}
Dim PasswordDatabase() As Integer = {111, 222, 333, 444, 555}
Dim objLogin As frmLogin
Dim u As String, p As Integer
Dim X As String, Y As Integer

Public Function GetUserInfoAndDisplayForm(ByRef X, ByRef Y)
objLogin = New frmLogin
objLogin.ShowDialog()

X = objLogin.txtUsername.Text
Y = objLogin.txtPassword.Text

Authenticate(u, p)

End Function



Sub Main()
GetUserInfoAndDisplayForm(u, p)

If bool = True Then
MessageBox.Show("Access Granted")
ElseIf bool = False Then
MessageBox.Show("Access Denied")
End If

' objLogin.ShowDialog()
'GetUserInfoAndDisplayForm(X, Y)

End Sub

Private Function Authenticate(ByVal X, ByVal Y)
Dim i As Integer


' Do While X <> -1 And Y <> -1
For i = 0 To 4
If UsernameDatabase(i) = X And PasswordDatabase(i) = Y Then
bool = True
Else
bool = False
End If
Next
Return bool
'Loop
End Function
End Module









This is the form part:
*note* there is no futher coding in this area. The rest of coding is done in module.


Private Sub btnOk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click
Me.Hide()


End Sub

Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
MessageBox.Show("User Canceled Operation")

txtUsername.Text = " "
txtPassword.Text = " "
End Sub


Private Sub frmLogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub

End Class

_________________
Back to top
View user's profile Send private message Send e-mail
TheTaxidermist
Lost soul



Joined: 28 Aug 2005
Posts: 1456
Location: England

PostPosted: Mon Sep 26, 2005 9:19 am    Post subject: Reply with quote

Sad

If only you needed darkbasic help, then I could show off Cool
_________________
Back to top
View user's profile Send private message MSN Messenger
RockyB
Lost soul



Joined: 12 Jul 2005
Posts: 1639
Location: Leicester

PostPosted: Mon Sep 26, 2005 12:14 pm    Post subject: Reply with quote

Or Delphi Wink
_________________
New ST site :: New ST Forums
Back to top
View user's profile Send private message Visit poster's website
Devaude
Antares First Mate



Joined: 30 Aug 2005
Posts: 1349

PostPosted: Mon Sep 26, 2005 12:39 pm    Post subject: Reply with quote

i can help with C, C++ (MFC), PHP, ColdFusion, Java. Rolling Eyes
_________________


'Like... Dude... What the hell...' - d4sh
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Procurator
Chief Archivist,
Aggregator Captain



Joined: 21 May 2005
Posts: 3815
Location: HvCFT Aggregator, Syntax

PostPosted: Mon Sep 26, 2005 1:09 pm    Post subject: Reply with quote

Just PHP and, ahem, Fortran from me, I'm afraid. Wink
_________________
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Obelon




Joined: 22 Sep 2005
Posts: 4
Location: Glasgow, Scotland

PostPosted: Mon Sep 26, 2005 5:32 pm    Post subject: Reply with quote

I only know php and flash action scripts.

the only thing I can see and I am saying this without even knowing visual net

' Do While X <> -1 And Y <> -1
For i = 0 To 4
If UsernameDatabase(i) = X And PasswordDatabase(i) = Y Then
bool = True
Else
bool = False
End If
Next
Return bool
'Loop
End Function

I am guessing in the above varible i auto increments if it dosn't you will need to add to its count done in php like i=++ or i=i+1

other thing is "Return bool" again not know the language I am guessing this is ment to take you out of the loop when the bool is true and if it dose that ignore me but get the feeling it should be return if bool = true or something like that.

The layout itself seems a bit haphazzard but I am guessing thats visual net (remember I am use to php).

sorry I can't be more help.
Back to top
View user's profile Send private message Send e-mail
TheTaxidermist
Lost soul



Joined: 28 Aug 2005
Posts: 1456
Location: England

PostPosted: Mon Sep 26, 2005 5:35 pm    Post subject: Reply with quote

it would probably be easier to hack your way through the password screen Razz
_________________
Back to top
View user's profile Send private message MSN Messenger
globin




Joined: 24 Apr 2005
Posts: 285
Location: HvCFT Assembler

PostPosted: Mon Sep 26, 2005 9:59 pm    Post subject: Reply with quote

*laughs*

I won't even bother Sad
_________________



Back to top
View user's profile Send private message Send e-mail
Redeemer




Joined: 08 Jul 2004
Posts: 38
Location: NYC

PostPosted: Tue Sep 27, 2005 3:38 am    Post subject: Reply with quote

TheTaxidermist wrote:
it would probably be easier to hack your way through the password screen Razz

Lolz

Thanks guys but i found where the problem was.
I do have some C++ i need help with
_________________
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    The Glitch Society Forum Index -> Off-Topic -> Anything All times are GMT
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum