首页  编辑  

文件中写入读取指定编码字符

Tags: /C#/文件目录操作/   Date Created:

using System . IO;

using ( StreamWriter vStreamWriter = new StreamWriter (

    @"c:\temp\temp.txt" , false , Encoding . Default))

   vStreamWriter . Write( "Zswang );

using ( StreamReader vStreamReader = new StreamReader (

    @"c:\temp\temp.txt" , Encoding . Default))

   textBox1 . Text = vStreamReader . ReadToEnd();