textbox to a .txt
-
Hi guys, the name pretty much says it all, I am as far as savedialogfile but i am completly stuck. My aim is to save a .txt from a textbox with a button. Thanks in advance, Brad
In VB2005, there's something like File.SaveAllText("filepath", "Text");
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
In VB2005, there's something like File.SaveAllText("filepath", "Text");
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi, thanks for teh reply, i still cannot get it to work. Any more ideas or anything specific to know. Thanks
The problem is sufficiently trivial that if you define 'cannot get it to work' and post your code, I'm sure I can help.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
The problem is sufficiently trivial that if you define 'cannot get it to work' and post your code, I'm sure I can help.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Hi Christian, At the moment i acually have no code for what i want to do as i have been trailing and erroring for a few hours now but here is screenshot of my design and the code for the form so far. 'button3' is what i want to actually save me file, as of the above posts i want to edit the textboxes and then save/overwrite teh existing file that it is reading from. Hope this helps you out with helping me. [IMG]http://i124.photobucket.com/albums/p14/Br4dZ/code.jpg\[/IMG\] Thanks again
-
Hi Christian, At the moment i acually have no code for what i want to do as i have been trailing and erroring for a few hours now but here is screenshot of my design and the code for the form so far. 'button3' is what i want to actually save me file, as of the above posts i want to edit the textboxes and then save/overwrite teh existing file that it is reading from. Hope this helps you out with helping me. [IMG]http://i124.photobucket.com/albums/p14/Br4dZ/code.jpg\[/IMG\] Thanks again
I'm at a loss. I gave you one line of code, and you're saying you have no code in your app yet, but the line I gave you doesn't work ? File.WriteAllText will indeed overwrite the file at the path you provide, with the string you pass into it. Which bit is causing you grief ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I'm at a loss. I gave you one line of code, and you're saying you have no code in your app yet, but the line I gave you doesn't work ? File.WriteAllText will indeed overwrite the file at the path you provide, with the string you pass into it. Which bit is causing you grief ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I'm at a loss. I gave you one line of code, and you're saying you have no code in your app yet, but the line I gave you doesn't work ? File.WriteAllText will indeed overwrite the file at the path you provide, with the string you pass into it. Which bit is causing you grief ?
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
VB kep throwing expression errors, i have tried to work around it but it is not working at all, I am 18 and been coding for a few months so please excuse my stupidness.
Oh, my bad. It's System.IO.File.WriteAllText if you don't have System.IO scoped in already, you need to put the whole thing.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
VB keeps on thrwoing expression errors when i use your code and havw tried to work around it to get it to work but no luck. Please excuse my stupidness as i have been coding for a few months.
-
My.Computer.FileSystem.WriteAllText("C:\filename.txt", TextBox1.Text, True) That is how I have done it! Thanks for the help Christian!
No problem. That's a shortcut for System.IO.File.WriteAllText, it does the same thing. My is a shortcut for VB only, not C#.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hi guys, the name pretty much says it all, I am as far as savedialogfile but i am completly stuck. My aim is to save a .txt from a textbox with a button. Thanks in advance, Brad