Click here to Skip to main content
15,892,289 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionV.B 6 Pin
J.Paul Ghetty8-Jan-07 15:12
J.Paul Ghetty8-Jan-07 15:12 
AnswerRe: V.B 6 Pin
Christian Graus8-Jan-07 15:21
protectorChristian Graus8-Jan-07 15:21 
QuestionDatagrid - Refresh Pin
Larry White8-Jan-07 11:19
Larry White8-Jan-07 11:19 
AnswerRe: Datagrid - Refresh Pin
Christian Graus8-Jan-07 12:49
protectorChristian Graus8-Jan-07 12:49 
GeneralRe: Datagrid - Refresh Pin
Larry White9-Jan-07 4:53
Larry White9-Jan-07 4:53 
QuestionMDI Forms Pin
Jason Timothy Holland8-Jan-07 10:01
Jason Timothy Holland8-Jan-07 10:01 
AnswerRe: MDI Forms Pin
Dave Kreskowiak8-Jan-07 10:09
mveDave Kreskowiak8-Jan-07 10:09 
QuestionEncrypt File using User Supplied Password Pin
hkinser98-Jan-07 9:57
hkinser98-Jan-07 9:57 
Hello everyone.

I've read several articles on the internet in trying to figure this out; however, those article seem a bit over my head apparently and I can't seem to find a code example that is simple and to the point to implement.

I'm coding a password manager program in vb 2005. All that is left to do is obtain a password from the user the first time they start the program, and use that password as the encryption key in creating the file that will hold the data from the listview control.

For now, the login form is simply taking the password the user enters and encrypting it inside a separate file for now as you will see below - the file itself is not encrypted. I have all the forms complete and the listview data is writing to a currently unencrypted file for now. I just want to make it all one file with the user password being the key to encrypt it all.

Here is the login code I'm using if we can somehow modify it to do what I'm looking for:

If txtUserPsw.Text = txtPswVerify.Text And Me.txtPswVerify.Text.Length >= 8 Then
Try
' Obtain a FileStream object.
Dim aFileStream As New FileStream(AppPath(False) & "\passsafe.bin", FileMode.Create)
' Obtain a BinaryWriter object.
Dim aBinaryWriter As New BinaryWriter(aFileStream)
' Encrypt the new password and binary write to a binary file.
aBinaryWriter.Write(EncryptPassword.EncryptString(Me.txtPswVerify.Text))
' Close the FileStream and the BinaryWriter objects.
aFileStream.Close()
aBinaryWriter.Close()
' Message user.
MessageBox.Show("Password was encrypted and saved. Don't forget it!")
'Display Main form (Frmlogin)
Dim safe As New frmSafe
'Hides login form
Me.Visible = False
safe.ShowDialog()
'disposes login form on exit of main form
'Application.Exit()
Me.Close()
Catch ex As Exception
' Message user.
MessageBox.Show("Password was not saved. ERROR: " & ex.Message)
End Try
End If

Thanks everyone!

Sincerely,
Harold
QuestionPrinting landscape pages not working Pin
Knoen8-Jan-07 9:39
Knoen8-Jan-07 9:39 
QuestionDataGridView.Columns.AddRange Pin
kindman_nb8-Jan-07 9:10
kindman_nb8-Jan-07 9:10 
AnswerRe: DataGridView.Columns.AddRange Pin
Dave Kreskowiak8-Jan-07 9:20
mveDave Kreskowiak8-Jan-07 9:20 
GeneralRe: DataGridView.Columns.AddRange Pin
kindman_nb8-Jan-07 10:39
kindman_nb8-Jan-07 10:39 
GeneralRe: DataGridView.Columns.AddRange Pin
Dave Kreskowiak9-Jan-07 2:53
mveDave Kreskowiak9-Jan-07 2:53 
GeneralRe: DataGridView.Columns.AddRange Pin
kindman_nb9-Jan-07 7:25
kindman_nb9-Jan-07 7:25 
QuestionShared Printer (send it a string) Pin
oogyboogyme8-Jan-07 9:02
oogyboogyme8-Jan-07 9:02 
AnswerRe: Shared Printer (send it a string) Pin
Dave Kreskowiak8-Jan-07 9:17
mveDave Kreskowiak8-Jan-07 9:17 
QuestionImage Comparision Pin
ParticleBoy8-Jan-07 8:11
ParticleBoy8-Jan-07 8:11 
AnswerRe: Image Comparision Pin
Christian Graus8-Jan-07 9:13
protectorChristian Graus8-Jan-07 9:13 
QuestionDatabase Error Pin
Karma312518-Jan-07 8:06
Karma312518-Jan-07 8:06 
AnswerRe: Database Error Pin
Dave Kreskowiak8-Jan-07 9:13
mveDave Kreskowiak8-Jan-07 9:13 
GeneralRe: Database Error Pin
Karma312519-Jan-07 4:02
Karma312519-Jan-07 4:02 
GeneralRe: Database Error Pin
Dave Kreskowiak9-Jan-07 12:32
mveDave Kreskowiak9-Jan-07 12:32 
QuestionMDI Forms Pin
Jason Holland8-Jan-07 7:44
Jason Holland8-Jan-07 7:44 
AnswerRe: MDI Forms Pin
nlarson118-Jan-07 8:02
nlarson118-Jan-07 8:02 
QuestionMDI Forms Pin
Jason Holland8-Jan-07 7:44
Jason Holland8-Jan-07 7:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.