473,385 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Multiple Passwords

This is the code that I currently Have for one password
how do I specify multiple ones? There is no "or"
statement! What do I do?

Private Sub LoginBTN_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles LoginBTN.Click
If PassINP.Text = "bluecats" And UserINP.Text
= "Joshua" Then Dim frmMainApp As New frmMainApp() :
frmMainApp.Show() Else End
End Sub
End Class

Nov 20 '05 #1
4 1216
On Sun, 9 Nov 2003 11:00:52 -0800, Joshua Kendall wrote:
This is the code that I currently Have for one password
how do I specify multiple ones? There is no "or"
statement! What do I do?

Private Sub LoginBTN_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles LoginBTN.Click
If PassINP.Text = "bluecats" And UserINP.Text
= "Joshua" Then Dim frmMainApp As New frmMainApp() :
frmMainApp.Show() Else End
End Sub
End Class


What do you mean there is no "Or"? sure there is.
You can write:
If txt.text = "x" or txt.text="y" then
'do something
end if

you can also use a "case" for this sort of thing:
select case txt.Text

case "a","b","c"
'do something

case else
msgbox "bad password"
end select

note, however, that it is considered bad form to hard code passwords inside
your code. It is better to save to in a database or at least the config
file of your application so they can later be changed and maintained
without having to recompile your code.
another bad thing that can happen: your code can be "decompiled" using a
tool like "Refelctor" or "Anakrino" and the passwords can be taken from it
easily.
That's why it's usually better to save the passwords in an encrypted state
somewhere as well.

--
Roy Osherove
weblog: http://www.iserializable.com
Nov 20 '05 #2
Thank you the "or" statement was in the wrong place,
that's why it wasn't showing up valid. How could I access
passwords if I saved them in a dbase III file? and how
could I encode them?

Thanks for the help!

Joshua Kendall
Nov 20 '05 #3
"Joshua Kendall" <jo****@goartic.com> wrote...
This is the code that I currently Have for one password
how do I specify multiple ones? There is no "or"
statement! What do I do?


Joshua... what are doing? You are posting messages under various accounts
and you start new threads all the time.

I tried to explain it earlier and you are doing the same thing now. The
"write a line of code" post a question methodology. My suggestion is to
stop and think. Design something that makes sense rather than coding
whatever strikes you this minute. A couple of messages ago it was a timer
issue on a dialog box, now it is how to hardcode a bunch of account/password
pairs and in another thread you have the "splash screen won't go away"
problem.

You are designing an unmaintainable mess and that can't be your purpose.
How can you even ask about how to access data from a dBASE file if you can't
turn the timer off or make the splash screen disappear? You aren't 100
lines of code away from finishing this, you are conceptually _eons_ away.
You have your spaceship launched and you are radioing back to Earth, "which
way is Mars?"

Consider pseudocode. Know what you are trying to program before you spend
your time (and ours) trying to code something that won't work should you be
lucky enough to remove all the bugs. Contrary to popular belief software
development isn't a matter of overcoming bugs... it's an engineering task.
Try (I'm trying to be helpful) reading the code you just posted... you
created a variable frmMainApp in the event handler. Where do you think that
variable will go when the event handler ends?

I think we are all wondering is it a password application you're writing
because so far you don't have that. Finish the application first and add a
password layer around it. No architect I know of designs the stairs to the
building "before" they have designed the building itself.

Finish frmMainApp()... have it operate without any worry about whether some
stranger has gained access (they won't have if you don't finish the app.)
Then when it is all finished post a single question (if a Google search
doesn't answer it) similar to "how do I add account/password verification to
my app?"

I may sound rude but I'm saving you 40 hours of posting questions. Nobody
wants to explain how to hide your splash screen when it starts the app
because nobody would do it that way. At least not "twice" :-)

"Slow down" I don't know how many times I have suggested programmers
"program" by simply taking their fingers off the keyboard.

Tom



Nov 20 '05 #4
Cor
Hi Tom,

I am looking to it and see everytime another come in. Good that you wrote
this, but this I found specialy good.
Finish frmMainApp()... have it operate without any worry about whether some stranger has gained access (they won't have if you don't finish the app.)


ROFL but with sence

Cor
Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Miranda | last post by:
Hi, I have a ASP/vbscript program that generates random passwords. The problem is I need to insert those passwords into an Access database of 327 clients. I have the random password program...
2
by: Mr. Bungle | last post by:
Hello, I have a password management database in which I can scroll through a list of employees for a specific location. I have a nifty generate password procedure that we use to change passwords...
2
by: TechBoy | last post by:
I am trying to learn on the fly about Access Security for an app we are developing. I realize Access security is an advanced subject with many details. I wanted to share a scenario and ask a...
18
by: Gleep | last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this. The goal I don't want clients to give out their usernames and passwords to friends, since the site...
19
by: Cord-Heinrich Pahlmann | last post by:
Hi, I have written a tool wich de/encrypts a few of my forum and bloggin-Passwords. My question is how secure it is. The following describes how I have encrypted my passwords. When I log in,...
3
by: anuragpj | last post by:
i have designed a login page like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Electrical Engineering Dept...
2
by: Simon.Whiteside | last post by:
If someone has created a database for me and transferred it over is there any way that I can check I have full access to all areas? I am a beginner with Access and so the development has been...
5
by: arlu1221 | last post by:
I have a mdb that needs to be used by multiple users. I am aware of the Tools -> Security option to create multiple users. However, do i need to create a table in the mdb too that keeps track of...
7
by: wozza | last post by:
hi I'm a Dreamweaver user who's created a few simple data entry/ registrations forms in my time, but I'm not really a coder (though I can follow instructions and am not afraid to dabble...) - I...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.