'Start copyright notice 'Copyright www.SyntheticTelepathy.com 2009 'Visit www.SyntheticTelepathy.com for compiled versions of this Password Generator 'and other tools of interest to those concerned with synthetic telepathy 'You may not remove this copyright notice 'You must include this copyright notice on any ports or code that reuses this code 'You may add addendum's to this copyright notice to note changes 'You are granted the right to use this code as you wish 'End copyright notice 'This code compiles with the free Visual Basic Express 2008 from Microsoft 'to use it create a new Visual Basic forms project and drop three buttons, 'an OpenFileDialog and a SaveFileDialog onto Form1, then paste this code 'into Form1's code Public Class Form1 Const PassWordLength = 8 Dim Password As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim L As Long Password = "" Randomize() For L = 1 To PassWordLength Password = Password + Chr(Int(Rnd() * 26 + 65)) Next SaveFileDialog1.ShowDialog() End Sub Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk System.IO.File.WriteAllText(SaveFileDialog1.FileName, Password) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click OpenFileDialog1.ShowDialog() End Sub Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk Clipboard.SetText(System.IO.File.ReadAllText(OpenFileDialog1.FileName)) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Me.Close() End Sub End Class