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

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

 更新時間:2015年07月15日 13:00:27   作者:pythoner  
這篇文章主要介紹了C#通過流寫入一行數(shù)據(jù)到文件的方法,涉及C#針對文本文件讀寫的基本技巧,具有一定參考借鑒價值,需要的朋友可以參考下

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

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(); }
  }
 }
}

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

相關(guān)文章

最新評論