VB Question Again?
#1
So on my random password generator i have the code below to generate the actual code:

Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = GenerateCode
End Sub

Public Function generateCode()
Dim intRnd As Integer
Dim intStep As Integer = Nothing
Dim strname As String
Dim intlength As Integer
Dim strinputstring As String = ""
Dim Numbers As String = "1234567890"
Dim Lower As String = "abcdefghijklmnopqrstuvwxyzyz`-=[];'#,./\"
Dim Upper As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZYZ¬!£$%^&*()_+{}:@~<>?|"
Dim intnamelength As Integer = 1

If CheckBox1.Checked Then strinputstring &= Numbers
If CheckBox2.Checked Then strinputstring &= Lower
If CheckBox3.Checked Then strinputstring &= Upper
intlength = Len(strinputstring)
Integer.TryParse(TextBox2.Text, intnamelength)
Randomize()
strname = ""
For inStep = 1 To intnamelength
intRnd = Int(Rnd() * intlength) + 1
strname = strname & Mid(strinputstring, intRnd, 1)
Next
Return strname
End Function
End Class

And the code below to copy the generated code:

Code:
TextBox1.SelectAll()
TextBox1.Copy()

I'm looking to. When i click on the COPY TAB on the form. It copies the generated password directly to NotePad which also opens NotePad showing the copied/pasted password when the COPY TAB is clicked?

Code additions (Full working examples of the code please) Smile Wink

And everyone. Feel free to build, alter, up-date, suggest on this VB Thread Smile

Thanks in advance,
Reply
#2
What you want to do is achievable but its likely far easier just to write the string of text out then shell execute the .txt file then the users preferred text editor will deal with the .txt
Reply
#3
(Nov 11, 2013, 19:42 pm)Kingfish Wrote: What you want to do is achievable but its likely far easier just to write the string of text out then shell execute the .txt file then the users preferred text editor will deal with the .txt

i'm absolutely new to code Kingfish Smile I'm looking for input from peeps to develop the code. Here's what i have so far (Pic and download link below. Coded in VB):

[Image: t3YBgDh.jpg]

http://www.filedropper.com/advancedpasswordgenerator
Reply
#4
Looking at your GUI it would appear that you dont really want to be dumping content to Notepad or a .txt file instead you want to just put the contents of the window on to the clipboard when the user clicks copy?
Reply
#5
Yeah that's what i have already Kf. But i'd want to try and develop it that it copies to a users password vault? And that cound be their browser password vault if you know what i mean
Reply
#6
You want to create an encrypted file that only your app can open?
Reply
#7
No.

1. You select if you want Numbers, LowerCase, UpperCase or all.
2. You select how long you want the generated password to be.
3. You click "generate" and it's there.

all the above i have.

4. You select copy and it copies/pastes the generated password and:

A) It either opens and pastes direct to NotePad.

or


B) It'll copy to your password vault (Which is the end aim/goal that i'd like to achieve).

Absolutely no encryption except on the actual application code itself to stop it from being posted as mine if you know what i mean.

Right. I now have it so NotePad will open on a click event:

Code:
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Shell("Notepad", 1)
    End Sub
End Class

And the copy command from above:

Code:
TextBox1.SelectAll()
TextBox1.Copy()

So now all i need is to get it so it copies the generated password. Opens Notepad and pastes the password to Notepad all on 1 click event? Any suggestions?
Reply
#8
Code:
'your code

yourstring = "I hate the World"
AppActivate("Document - WordPad")
System.Windows.Forms.SendKeys.Send(yourstring)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Question About the Concept of Abstracts in Java RobertX 4 5,671 Jan 17, 2024, 07:50 am
Last Post: gulshan212
  Need help with statistics interview question Avantika_Sharmaa24 2 9,359 Aug 25, 2023, 10:19 am
Last Post: gulshan212
  Question about javascript f0xxii 2 27,606 Sep 02, 2021, 14:16 pm
Last Post: bertanen
  Hacked site question Fellicowh 1 22,066 Jun 20, 2019, 11:04 am
Last Post: Moe
  VB Question? -nelly- 6 24,748 Nov 02, 2013, 21:05 pm
Last Post: -nelly-



Users browsing this thread: 4 Guest(s)