小编Geo*_*rge的帖子

如何使用MONO Develop在Linux中用C#写入文本文件

我使用Ubunto OS与MONO Develop和Im编程与C#.

我想写入文本文件,但我不知道该怎么做.

我试过这个:

string[] lines = {"some text1", "some text2", "some text3"};
System.IO.File.WriteAllLines(@"/home/myuser/someText.txt", lines);
Run Code Online (Sandbox Code Playgroud)

这没用.

我试过这个:

string str = "some text";

StreamWriter a = new StreamWriter("/home/myuser/someText.txt");

a.Write(str);
Run Code Online (Sandbox Code Playgroud)

这也行不通.

该怎么办?

TNX.

c# linux ubuntu monodevelop

1
推荐指数
1
解决办法
6987
查看次数

标签 统计

c# ×1

linux ×1

monodevelop ×1

ubuntu ×1