简单文件输出函数

       public static void Write(string context, string name)
        {
            string s = "C:\\Users\\";
            s = s + name+ ".txt";
            FileStream fs = new FileStream(s, FileMode.Create);
            byte[] data = System.Text.Encoding.Default.GetBytes(context);
            fs.Write(data, 0, data.Length);
            fs.Flush();
            fs.Close();
        }

猜你喜欢

转载自blog.csdn.net/qq_15555767/article/details/77411577
今日推荐