欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

C#通過流寫入數(shù)據(jù)到文件的方法

 更新時(shí)間:2015年07月03日 12:15:02   作者:pythoner  
這篇文章主要介紹了C#通過流寫入數(shù)據(jù)到文件的方法,涉及C#通過字節(jié)流讀寫文件的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了C#通過流寫入數(shù)據(jù)到文件的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

using System;
using System.IO;
public class WriteFileStuff {
public static void Main() {
  FileStream fs = new FileStream("c:\\tmp\\WriteFileStuff.txt", FileMode.OpenOrCreate, FileAccess.Write);  
  StreamWriter sw = new StreamWriter(fs);
  try {
 sw.WriteLine("Howdy World.");
 } finally {
 if(sw != null) { sw.Close(); }
 }
 }
}

希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論