更新时间:2023-01-23 10:46:37
将文本写入文件系统。 IO.File.WriteAllText
方法并将文本附加到现有文件System.IO.File.AppendAllText
方法可以使用
这里给出一个例子
http://msdn.microsoft.com/en-us/library/ms143375.aspx [ ^ ]
这个可能对你有所帮助。
To write text to fileSystem.IO.File.WriteAllText
method and to append text to the existing fileSystem.IO.File.AppendAllText
method can be used
An example is given here
http://msdn.microsoft.com/en-us/library/ms143375.aspx[^]
This may be helpful to you.
对不起谷歌已经坏了。 File.Create [ ^ ]
I'm sorry Google is broken. File.Create[^]
如果您只需要使用文件类,这就是您的解决方案,
If you need only use file class, this is the solution for you,
File.WriteAllText("D:\\as.txt", "welcome");