将文本追加到文本文件每一行的末尾(控制台) [英] append text to end of each line of textfile (console)
问题描述
大家好,
我是C#的新手,并且使用此Lanuage处于学习曲线上,对您的帮助将非常棒:
简而言之,我希望能够读取位于我的C驱动器上的文本文件,然后将字符串"\ SHARE"附加到每一行的末尾,然后再次保存该文件.
TEXTFILE:
\\ COMPUTER1
\\ COMPUTER2
\\ COMPUTER3
输出:
\\ COMPUTER1 \ SHARE
\\ COMPUTER2 \ SHARE
\\ COMPUTER3 \ SHARE
我不知道它与for next循环有关,但是我有点卡住了...
如果有人能指出我的写作方向,我将对此表示赞赏.
谢谢
Hi All,
I am new to C# and on a learning curve with this Lanuage and any help would be awesomely appericated:
but in a nutshell i want to be able to read a text file located on my C Drive and then append the string "\SHARE" to the end of each line and then save the file again.
TEXTFILE:
\\COMPUTER1
\\COMPUTER2
\\COMPUTER3
OUTPUT:
\\COMPUTER1\SHARE
\\COMPUTER2\SHARE
\\COMPUTER3\SHARE
i no it has something to do with a for next loop but im just bit stuck...
If anyone would be able point me in the write direction would really appreicate it.
Thanks
推荐答案
阅读此 [
这篇关于将文本追加到文本文件每一行的末尾(控制台)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!