zoukankan      html  css  js  c++  java
  • VB.NET 操作16进制文件

    ' 用到System.IO.Stream类
    
    Imports System.IO          '导入引用类
     
            Dim fs As FileStream
            Dim br As BinaryReader
            fs = New FileStream(“1.dat”, FileMode.Open, FileAccess.Read)
            br = New BinaryReader(fs)
            Dim sw As StreamWriter
            sw = New StreamWriter(“1.txt”)
     
            Dim header_ID As Char() = br.ReadChars(10)                  '10 bytes
            Dim header_card_type As Short = br.ReadInt16                '2 bytes
            Dim header_num_of_channel As Short = br.ReadInt16           '2 bytes
            Dim header_channel_no As Byte = br.ReadByte                 '1 bytes
            Dim header_num_of_scan As Long = br.ReadUInt32              '4 bytes
            Dim header_data_width As Short = br.ReadInt16               '2 bytes
            Dim header_channel_order As Short = br.ReadInt16            '2 bytes
            Dim header_ad_range As Short = br.ReadInt16                 '2 bytes
            Dim header_ad_rate As Double = br.ReadDouble                '8 bytes
            Dim header_num_of_channel_range As Short = br.ReadInt16     '2 bytes
            Dim header_start_data As Char() = br.ReadChars(8)           '8 bytes
            Dim header_start_time As Char() = br.ReadChars(8)           '8 bytes
            Dim header_start_millisec As Char() = br.ReadChars(3)       '3 bytes
            Dim header_reserved As Char() = br.ReadChars(6)             '6 bytes
             
            sw.Write(vbCrLf)
             
            sw.Close()
            fs.Close()
            br.Close()
  • 相关阅读:
    BSGS算法(大步小步算法)
    UVA-11426【GCD
    UVA-1637【Double Patience】(概率dp)
    UVA-11174【Stand in a Line】
    About
    51nod 1355 斐波那契的最小公倍数
    CodeForces
    CodeForces
    CodeForces
    CodeForces 901C Bipartite Segments
  • 原文地址:https://www.cnblogs.com/jmpep/p/4486294.html
Copyright © 2011-2022 走看看