TextWriter tw = new StreamWriter("Globaldata.txt");
tw.WriteLine("123\r\n" + "5345"); // \r\n換行
tw.WriteLine("123\r\n" + "5345");
tw.Close();
讀取
TextReader xx = new StreamReader("Globaldata.txt");
string line = "";
while ((line = xx.ReadLine()) != null)
{
Console.WriteLine(line);
}
沒有留言:
張貼留言