本文實例講述了C#使用文件流讀取文件的方法。分享給大家供大家參考。具體如下:
using System;using System.IO;namespace Client.Chapter_11___File_and_Streams{ public class OpenExistingFile { static void Main(string[] args) { FileInfo MyFile = new FileInfo(@"c:/Projects/Testing.txt"); FileStream MyStream; MyStream = MyFile.Open(FileMode.Open,FileAccess.Read,FileShare.None); } }}
希望本文所述對大家的C#程序設計有所幫助。
新聞熱點
疑難解答