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()
  • 相关阅读:
    CSS 备忘
    header操作cookie
    定时器传参数
    Display 和Visible 区别
    php 笔记
    概要设计要求
    iOS 之 UITextView
    iOS 按钮设置图片和事件
    iOS 设置控件圆角、文字、字体
    iOS 之 UIScrollView
  • 原文地址:https://www.cnblogs.com/jmpep/p/4486294.html
Copyright © 2011-2022 走看看