Changing password

K

krgatez

I have a console application in VB.NET that I have hard coded the
username/password for the SQL database. Haven't been programming for
long, so don't know much about the tools available.

The password will be changed regularly. Is there a way to store the
password, or grab it from somewhere so that the program will not have
to be recompiled everytime the password is changed? Any suggestions
would be appreciated.
 
B

Bob Hollness

encrypt it using the encryption classes in .NET and store it in an external
file. That way you only need to change the file.
 
G

Guest

You could store it in an xml file in the application data directory or in the
registry.

When you go to check your password against what has been entered by the
user, don't forget to call 'ZeroMemory' to wipe it from memory

Private Declare Sub ZeroMemory Lib "kernel32.dll" Alias "RtlZeroMemory" _
(ByVal Destination As String, ByVal Length As Integer)

ZeroMemory(txtPassword.Text, txtPassword.Text.Length * 2)

This clears the password entered into txtPassword (TextBox) & writes twice
the length of zeros
 
K

krgatez

I'd also like to encrypt the password. There is no user input, it is
just one username/password to access the SQL Server. I'm assuming that
an external source is the best choice. I'm not sure how to do that or
which is the best to use (XML, txt, mdb). Any examples would be
appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top