|
-
Dec 17th, 2003, 06:47 PM
#1
Thread Starter
Addicted Member
How to use InputBox with StreamWriter [Resolved]
HI All!
I’ve been trying this for a while now and am still unable to make this work.
In my menu I am making a call to an InputBox and the result of the InputBox is supposed to be used to Create or Replace a file in my App. Folder.
I’m trying to do this with the StreamWriter but I can’t seem to be able to get the coding together.
VB Code:
Dim Prompt, rout As String
Prompt = "Please input your Banks Routing Number"
rout = InputBox(Prompt, "Routing Number")
‘?????????
Can someone Pease give me an example on how to finish this line.??
The only thing I know how to do is create a File with StreamWriter but I don’t know how to do it in conjunction with an InputBox.
Thanks!!
Last edited by Rally2000; Dec 17th, 2003 at 07:52 PM.
-
Dec 17th, 2003, 06:48 PM
#2
yay gay
I dont get what you want. You want to create a file? open a file? which should be the file's name?
\m/  \m/
-
Dec 17th, 2003, 06:50 PM
#3
Thread Starter
Addicted Member
I want to create or replace a File "rout.txt"
-
Dec 17th, 2003, 06:56 PM
#4
yay gay
C# code:
Code:
StreamWriter sw = new StreamWriter("C:\\lol.txt");
using (sw) {
sw.WriteLine("your text here");
sw.Close();
}
I believe it's equivalent in vb.net is something like:
Code:
Dim sw as new StreamWriter("rout.txt")
sw.Writeline("your text here")
sw.Close()
\m/  \m/
-
Dec 17th, 2003, 07:23 PM
#5
Thread Starter
Addicted Member
Sorry! That still don't help the text that is supposed to be replaced needs to be taken from the InputBox result.
That is the part I'm having trouble with.
Thanks!!
-
Dec 17th, 2003, 07:27 PM
#6
yay gay
So you want to open the file rout.txt, and replace what the user puts in the inputbox? but replace by what?
\m/  \m/
-
Dec 17th, 2003, 07:37 PM
#7
Thread Starter
Addicted Member
No! Sorry if I’m not making myself clear enough!
I’m going to put it in steps.
1. User goes to menu and selects New Routing #
2. Input Box pops up asking the User to enter new Routing Number
3. Input from input box needs to replace an existing file in a Folder that I’m using to display a routing Number in a Label
I did not feel comfortable enough to use Reg. so I went with File IO.
Hope this explains it better
Thanks!
-
Dec 17th, 2003, 07:51 PM
#8
Thread Starter
Addicted Member
Never mind!
Format had me fouled up.
Got it going now.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|