欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

C#實(shí)現(xiàn)的基于二進(jìn)制讀寫文件操作示例

本文實(shí)例講述了C#實(shí)現(xiàn)的基于二進(jìn)制讀寫文件操作。分享給大家供大家參考,具體如下:

成都創(chuàng)新互聯(lián)公司是創(chuàng)新、創(chuàng)意、研發(fā)型一體的綜合型網(wǎng)站建設(shè)公司,自成立以來(lái)公司不斷探索創(chuàng)新,始終堅(jiān)持為客戶提供滿意周到的服務(wù),在本地打下了良好的口碑,在過(guò)去的十多年時(shí)間我們累計(jì)服務(wù)了上千家以及全國(guó)政企客戶,如戶外休閑椅等企業(yè)單位,完善的項(xiàng)目管理流程,嚴(yán)格把控項(xiàng)目進(jìn)度與質(zhì)量監(jiān)控加上過(guò)硬的技術(shù)實(shí)力獲得客戶的一致稱譽(yù)。

using System;
using System.IO;
class MyStream 
{
  private const string FILE_NAME = "Test.data";
  public static void Main(String[] args) 
  {
    // Create the new, empty data file.
    if (File.Exists(FILE_NAME)) 
    {
      Console.WriteLine("{0} already exists!", FILE_NAME);
      return;
    }
    FileStream fs = new FileStream(FILE_NAME, FileMode.CreateNew);
    // Create the writer for data.
    BinaryWriter w = new BinaryWriter(fs);
    // Write data to Test.data.
    for (int i = 0; i < 11; i++) 
    {
      w.Write( (int) i);
    }
    w.Close();
    fs.Close();
    // Create the reader for data.
    fs = new FileStream(FILE_NAME, FileMode.Open, FileAccess.Read);
    BinaryReader r = new BinaryReader(fs);
    // Read data from Test.data.
    for (int i = 0; i < 11; i++) 
    {
      Console.WriteLine(r.ReadInt32());
    }
    w.Close();
  }
}

更多關(guān)于C#相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《C#文件操作常用技巧匯總》、《C#遍歷算法與技巧總結(jié)》、《C#程序設(shè)計(jì)之線程使用技巧總結(jié)》、《C#常見(jiàn)控件用法教程》、《WinForm控件用法總結(jié)》、《C#數(shù)據(jù)結(jié)構(gòu)與算法教程》及《C#面向?qū)ο蟪绦蛟O(shè)計(jì)入門教程》

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

網(wǎng)頁(yè)標(biāo)題:C#實(shí)現(xiàn)的基于二進(jìn)制讀寫文件操作示例
當(dāng)前網(wǎng)址:http://chinadenli.net/article24/pgphje.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、軟件開(kāi)發(fā)域名注冊(cè)、網(wǎng)站設(shè)計(jì)外貿(mào)建站、網(wǎng)站維護(hù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)