View previous topic :: View next topic |
Author |
Message |
Redeemer
Joined: 08 Jul 2004 Posts: 38 Location: NYC
|
Posted: Mon Sep 26, 2005 12:55 am Post subject: VB.net Please Help!! |
|
|
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. Can any of you programmers help me out??
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 |
|
|
TheTaxidermist Lost soul
Joined: 28 Aug 2005 Posts: 1456 Location: England
|
Posted: Mon Sep 26, 2005 9:19 am Post subject: |
|
|
If only you needed darkbasic help, then I could show off _________________
|
|
Back to top |
|
|
RockyB Lost soul
Joined: 12 Jul 2005 Posts: 1639 Location: Leicester
|
|
Back to top |
|
|
Devaude Antares First Mate
Joined: 30 Aug 2005 Posts: 1349
|
Posted: Mon Sep 26, 2005 12:39 pm Post subject: |
|
|
i can help with C, C++ (MFC), PHP, ColdFusion, Java. _________________
'Like... Dude... What the hell...' - d4sh |
|
Back to top |
|
|
Procurator Chief Archivist, Aggregator Captain
Joined: 21 May 2005 Posts: 3815 Location: HvCFT Aggregator, Syntax
|
Posted: Mon Sep 26, 2005 1:09 pm Post subject: |
|
|
Just PHP and, ahem, Fortran from me, I'm afraid. _________________
|
|
Back to top |
|
|
Obelon
Joined: 22 Sep 2005 Posts: 4 Location: Glasgow, Scotland
|
Posted: Mon Sep 26, 2005 5:32 pm Post subject: |
|
|
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 |
|
|
TheTaxidermist Lost soul
Joined: 28 Aug 2005 Posts: 1456 Location: England
|
Posted: Mon Sep 26, 2005 5:35 pm Post subject: |
|
|
it would probably be easier to hack your way through the password screen _________________
|
|
Back to top |
|
|
globin
Joined: 24 Apr 2005 Posts: 285 Location: HvCFT Assembler
|
Posted: Mon Sep 26, 2005 9:59 pm Post subject: |
|
|
*laughs*
I won't even bother _________________
|
|
Back to top |
|
|
Redeemer
Joined: 08 Jul 2004 Posts: 38 Location: NYC
|
Posted: Tue Sep 27, 2005 3:38 am Post subject: |
|
|
TheTaxidermist wrote: | it would probably be easier to hack your way through the password screen |
Lolz
Thanks guys but i found where the problem was.
I do have some C++ i need help with _________________
|
|
Back to top |
|
|
|