close
首先在using程式碼中到場:
- StreamReader ReadFile = new StreamReader(Filename); //開啟檔案
- }
using System.IO;
- byte[] BData; //宣佈陣列
- byte[] BData; //宣佈陣列
- //將二進制陣列寫入檔案中 第一個參數是二進制陣列 第二個代表資料肇端位置 第三個是資料長度
二進制檔讀取:
- byte[] BData;
- BData = new byte[FI.Length]; //初始化二進制陣列長度
5. BFile.Read(BData, 0, Convert.ToInt16(FI.Length));
6. //將二進制陣列寫入檔案中 第一個參數是二進制陣列 第二個代表資料肇端位置 第三個是資料長度
7. BFile.Close();
二進制檔寫入:
6. BFil.Flush();
7. BFile.Close();
- string SReadData = "";
- ReadFile.Close(); //封閉檔案
- StreamWriter WriteFile = new StreamWriter(Filename); //開啟檔案
- BFile.Write(BData翻譯社 0, BData.GetUpperBound(0) + 1);
- FileInfo FI = new FileInfo(Filename); //初始化FI物件 (為了得到檔案長度)
- FileStream BFile = new FileStream(Filename翻譯社 FileMode.Open); //開啟檔案串流
- FileStream BFile = new FileStream(Filename, FileMode.Create); //開啟檔案Filename
- {
- WriteFile.WriteLine("abcd"); //寫入文字
本文來自: http://mypaper.pchome.com.tw/middlehuang/post/1321687982有關翻譯的問題歡迎諮詢天成翻譯公司
文章標籤
全站熱搜