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()
  • 相关阅读:
    linux kill命令以及 信号
    rhel7 系统服务——unit(单元)
    redis集群在线迁移
    二、主目录 Makefile 分析(3)
    二、主目录 Makefile 分析(2)
    二、主目录 Makefile 分析(1)
    一、文档目录分析
    Linux下解压缩
    设备树
    轮询
  • 原文地址:https://www.cnblogs.com/jmpep/p/4486294.html
Copyright © 2011-2022 走看看