FileStream构造函数

 1 using System;
 2 using System.Collections.Generic;
 3 using System.Linq;
 4 using System.Text;
 5 using System.IO;
 6 
 7 namespace IOtext
 8 {
 9     class Program
10     {
11         static void Main(string[] args)
12         {
13             //打开一个文件夹,并且将信息追加到文件夹末尾
14             FileStream fs = new FileStream("c:\\iotext.txt", FileMode.Append, FileAccess.Write, FileShare.Write);
15             fs.Close();
16             StreamWriter sw = new StreamWriter("c:\\iotext.txt", true, Encoding.ASCII);
17             sw.Write("This is the appended line");
18             sw.Close();
19         }
20     }
21 }

 

posted @ 2012-07-17 08:54  哪啊哪啊神去村  阅读(481)  评论(2编辑  收藏  举报