Question:
Visual Basic Notepad File?
anonymous
2008-06-04 07:38:49 UTC
Hi,

How would I make visual basic create a notepad file with text on it when you click a button? So you choose your options then it generates a text document with different things - depending on what options you selected?
Six answers:
Palestini Detective
2008-06-04 08:03:42 UTC
I did it using VB.Net but saved them as .rtf files (Word), not .txt files (Notepad).



Create a Savefile Dilaog (name it sfd1) and double click it, then write this:

'This will make it save the file in Richtextbox1 as an RTF.

Richtextbox1.Savefile (sfd1.FileName)



Hope this helps!
latisha
2016-05-24 05:27:19 UTC
Open the file, read the password and compare it to the password entered by the user. If it matches, continue with the program. This is terrible from a security standpoint, though - the password is right there in the file in plain text, where anyone can read it. Proper security would call for at least storing it as a hash, hashing the password given by the user and seeing if the hashes match.
Ahmad
2008-06-04 07:50:23 UTC
you first needs to create the file and write its content using StreamWriter then open it using notepad:



'create the file

Dim FileSW As New System.IO.StreamWriter(New System.IO.FileStream("c:\test.txt", FileMode.Create))

FileSW.WriteLine("hello")

FileSW.WriteLine("hello again")

FileSW.Close()



'now open the file using notepad

System.Diagnostics.Process. Start ( "notepad" , "c:\test.txt" )





that was using VB.Net
tempaccount64
2008-06-04 07:52:12 UTC
Not familiar with Visual Basic, (I'm a C#/Java/ActionScript man myself) but this might help you out:



http://msdn.microsoft.com/en-us/library/1t4kyezf(VS.80).aspx
dinksdalton
2008-06-04 07:59:14 UTC
There are some informative websites where you might find an answer to your question.
Stilks
2008-06-04 08:00:46 UTC
If this is for work, you pay a VB programmer to do it. If this is for yourself, you buy VB for Dummies or something similar and learn how.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...