【使い方】
テキストデータを Shift-JIS コードに変換して出力するサンプルです。
/// <summary>
/// ファイルストリームにテキストを Shift-JIS コードに変換して出力します。
/// </summary>
/// <param name="fs">ファイルストリーム</param>
/// <param name="text">出力する文字列</param>
public void FileWriteText( FileStream fs, string text )
{
// 文字列を Shift-JIS コードに変換する
byte[] str = System.Text.Encoding.GetEncoding("Shift_JIS").GetBytes( text );
// ファイルストリームに出力する
fs.Write( str, 0, str.Length );
str = null;
}
|