Quantcast
Viewing all articles
Browse latest Browse all 27087

Code for writing a path of a file for input and output

For one of my classes our next assignment in VB 2010 is pretty simple: the user will type a file name into the "input" text box as well as type a file name into the "output" text box. These file names may or may not be the same word(s). Then, the user clicks the button "process." When this routine occurs, the program is to read whatever is in the input file (only dealing with txt files for both input & output) and then write that information to the output file.

I've worked before with the fvInput = File.OpenText("the path would go here") and here, "fvInput" is just the variable I usually choose when dealing with input. However, we usually use a path along the lines of ("C:/temp/filename.txt"). (the C drive & the "temp" folder are common locations to save things on our school computers).

However, this program requires the file to be saved as whatever the user types into the "input" text box. I have tried setting the path to C:/temp/txtInput.Text (so that the text property of the input textbox would be the file name) but that doesn't seem to work. Anyone know how I can get the specified file name that the user types in to open up?

Viewing all articles
Browse latest Browse all 27087

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>