QT二进制文件读取问题 3C

一个二进制文件正常读出来的数据应该是这样的图片说明
但是我用流都出来的都是这样的
1 0 65535 65535 0 65535 0 65536 0 65536 0 0 0 0
0 nan 0 -1 0 0 0 -65536 1 0 0 0 0 -65536
0 nan 0 -65536 265006 393220 19464192 4849664 0 0 131072 -65404928 65535 131071
0 2.122e-314 0 0 0 0 1 0 0 0 0 65536 0 0
0 2.122e-314 0 -1 65536 0 -65536 0 0 65535 0 65536 0 1
65536 5.56277e-309 6 297 74 0 0 3 -996 -65536 0 65535 0 65535
4294901760 0 65536 0 0 0 65535 0 0 0 -65535 0 65535 131071
求大神指点这样的二进制二进制文件怎么读?
01 00 00 00 18 fc ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 00 00 01 00 ff ff ff ff 00 00 00 00 00 00 ff ff 2e 0b 04 00 04 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 1a fc ff ff 00 00 ff ff 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 00 00 00 00 ff ff ff ff 00 00 01 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 01 00 00 00 00 00 01 00 00 00 00 00 01 00 00 00 ff ff ff ff 2e 0b 04 00 04 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 03 00 00 00 1c fc ff ff 00 00 ff ff 00 00 00 00 ff ff 00 00 00 00 00 00 ff ff 00 00 00 00 ff ff 01 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 ff ff 00 00 00 00 ff ff 00 00 ff ff 01 00 00 00 ff ff ff ff ff ff 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 ff ff 00 00 00 00 00 00 00 00 01 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 ff ff 00 00 2e 0b 03 00 04 00 07 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 04 00 00 00 1e fc ff ff 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 ff ff 01 00 00 00 ff ff 01 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 ff ff 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 01 00 00 00 00 00 ff ff 00 00 00 00 ff ff 00 00 ff ff 01 00 00 00 01 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 ff ff 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff ff ff 2e 0b 04 00 05 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 05 00 00 00 20 fc ff ff 00 00 ff ff 00 00 00 00 ff ff ff ff ff ff 01 00 00 00 01 00 00 00 ff ff 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 ff ff 00 00 00 00 00 00 01 00 ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 00 00 ff ff 00 00 00 00 00 00 ff ff 01 00 ff ff 01 00 fe ff 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 ff ff 00 00 ff ff ff ff 2e 0b 04 00 04 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00 22 fc ff ff 00 00 ff ff ff ff 01 00 ff ff 00 00 ff ff 00 00 00 00 00 00 00 00 ff ff 01 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 01 00 00 00 ff ff 00 00 01 00 01 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 00 00 00 00 ff ff 01 00 ff ff 00 00 00 00 ff ff ff ff ff ff ff ff 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 ff ff 01 00 00 00 01 00 00 00 00 00 00 00 00 00 ff ff 01 00 00 00 00 00 00 00 2d 0b 04 00 04 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 07 00 00 00 24 fc ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 ff ff 00 00 01 00 ff ff 01 00 00 00 01 00 01 00 01 00 00 00 00 00 01 00 01 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 00 00 01 00 ff ff 00 00 00 00 01 00 00 00 ff ff 00 00 ff ff 00 00 ff ff 00 00 00 00 00 00 01 00 ff ff ff ff 00 00 01 00 00 00 00 00 01 00 ff ff 00 00 ff ff 01 00 01 00 00 00 00 00 ff ff 00 00 01 00 01 00 ff ff 00 00 2e 0b 05 00 05 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 26 fc ff ff 00 00 ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 ff ff 00 00 00 00 00 00 01 00 00 00 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 01 00 ff ff 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 01 00 00 00 00 00 00 00 00 00 ff ff 01 00 ff ff 00 00 01 00 00 00 ff ff 01 00 00 00 ff ff 00 00 2d 0b 04 00 04 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 09 00 00 00 28 fc ff ff 00 00 ff ff 00 00 00 00 fe ff ff ff 00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 01 00 00 00 ff ff ff ff 00 00 00 00 ff ff 00 00 ff ff 01 00 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 ff ff 00 00 01 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 2e 0b 04 00 04 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 0a 00 00 00 2a fc ff ff 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 01 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 01 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ff ff 01 00 ff ff 00 00 01 00 00 00 00 00 ff ff 00 00 ff ff 01 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00 ff ff 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 2e 0b 03 00 04 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 0b 00 00 00 2c fc ff ff 01 00 00 00 00 00 00 00 ff ff 00 00 ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 01 00 00 00 01 00 00 00 00 00 01 00 01 00 01 00 00 00 00 00 01 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 2d 0b 04 00 04 00 06 00 00 00 29 01 00 00 4a 00 00 00 00 00 00 00 00 00 00 00 0c 00 00 00 2e fc ff ff 00 00

0

1个回答

贴出你的原始16进制的文件内容、预期的结果和你的程序才好进一步帮你。简单来说,你的流里面读取的数据类型和你的文件格式不匹配。

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
读取二进制文件读取二进制文件
读取二进制文件读取二进制文件读取二进制文件读取二进制文件读取二进制文件读取二进制文件读取二进制文件
Qt学习之路(56): 二进制文件读写
Qt学习之路(56): 二进制文件读写 2010-04-11 17:29:39 标签:Qt C++ 教程 QT教程 学习 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://devbean.blog.51cto.com/448512/293892 今天开始进入 Qt 的另一个部分:文件读写,也就是 IO。
qt中普通二进制文件的读写
1、文件的打开 QString filePath = getPath(); QString fileName = QString("%1/%2_%3.air").arg(filePath).arg(uasName).arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh-mm-ss")); this->m_file = new Q...
QT 二进制文件读取
用于以二进制的方式一次性读取文件的全部内容。版本是QT5.7
webservice4 二进制文件读取
webservice4 二进制文件读取 webservice4 二进制文件读取
std::ifstream以二进制方式读取图片文件,用Qt再将其转为图片(QImage::loadFromData()函数使用)
  上篇文章中谈到谈到ifstrem可以以二进制形式读取图片文件,读取方式与读取txt方式一样,将不再赘述。本文将重点讨论“如何将图片二进制数据转换为图片”。        实际很简单,借助QImage这个非常强大的工具类就可以实现,这个类实际可以直接加载图片文件的,我们先暂时忽略这一点。看看这是怎样的一个过程: 代码如下 #include "widget.h" #include "ui_...
Qt 学习 之 二进制文件读写
在上一章中,我们介绍了有关QFile和QFileInfo两个类的使用。我们提到,QIODevice提供了read()、readLine()等基本的操作。同时,Qt 还提供了更高一级的操作:用于二进制的流QDataStream和用于文本流的QTextStream。本节,我们将讲解有关QDataStream的使用以及一些技巧。下一章则是QTextStream的相关内容。QDataStream提供了基于Q
Qt学习之路之二进制文件读取
QDataSteam类提供了将二进制文件串行化的功能, 用实现基本数据类型, 例如char , int , char *, int等的串行化。 下面是使用QDataStream读写二进制文件示例。 binary.h #ifndef BINARY_H #define BINARY_H #include #include class Binary : public QWidget { p
Qt实现GUI的二进制文件读写操作(源码分析+工程打包+测试例子)
本人小菜一枚,上周老大要写一个Qt软件需求:实现二进制文件读写,写入Version(如intx型 104)、累加校验和(int型sum)、字符串(“deadbeaf”)其实在二进制的read上,是不做要求的,我目前用的是QTextStream读取的文本文件,并非QDataStream读取的二进制文件,所以这点说明下。源码+可执行文件+测试.bin文件 一并打包上传 资源实现的环境是 Ubuntu ...
Qt5--文件操作(2)读写二进制文件
。。。。。。
Qt之文件详解(二)二进制文件读写
在上一章中,我们介绍了有关QFile和QFileInfo两个类的使用。我们提到,QIODevice提供了read()、readLine()等基本的操作。同时,Qt 还提供了更高一级的操作:用于二进制的流QDataStream和用于文本流的QTextStream。本节,我们将讲解有关QDataStream的使用以及一些技巧。下一章则是QTextStream的相关内容。 QDataStream提
qt sql中二进制文件通过QByteArray读写
qt sql中二进制文件通过QByteArray读写 从数据库到文件 QSqlQuery myquery( *pDatabase);QByteArray myba;if(myquery.exec(sql)){QSqlRecord myrecord = myquery.record
QT读取二进制文件
void MainWindow::ReadPicture() { QByteArray m_data; QFile file("H:/BaiduYunDownload/Cache/test.jpg"); if(file.open(QIODevice::ReadOnly)) { m_data = file.readAll(); cout
STL文件读写操作
#include <iostream>#include <fstream>#include <string>using namespace std;int main(){// ifstream input("./in.txt", ios::in | ios::binary);// ofstream output("./out.txt",ios::ou...
matlab文件读取
详细介绍了matlab中的文件读取命令,txt读取、二进制文件读取、shape文件读取等
Qt---多种方式读写二进制文件
#include "mainwindow.h" #include <QApplication> #include <QFile> #include <QDataStream>int main(int argc, char *argv[]) { QApplication a(argc, argv); //写二进制文件 QFile file("F:/1.txt"); if(
读取二进制文件到txt,包括大小端转换
不多说,直接上代码 #include #include #include #include #include #include using namespace std; #define L  101        #define M  102     #define N  103 void OnChange(float InParam, float &OutPar
读取BMP文件并显示出来(C++实现)
读取BMP文件的时候我们首先需要弄清楚bmp格式文件的结构 bmp的文件格式 bmp文件包含在windows.h的头文件里。编写代码的时候可以直接调用Windows.h 头文件来调用。
Qt读写二进制文件
下面是简单的二进制读写示例 #include #include #include #include using namespace std; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QFile file("test.dat"); file.open(QIODevice::WriteOnly
Python读二进制文件遇到的问题
 近日,需要用Python读取二进制文件(见上图),然后解析出想要的数据,转化成16进制,在显示出来  fp = open(path,r+) s= fp.read(ioneblock) while != s : t = s.encode(hex) print
读取二进制文件特定位置的某些字节
最简单的方式,取得文件的所有字节数,然后再处理 byte[] test = File.ReadAllBytes(file).Skip(50).Take(10).ToArray();
二进制文件问题
C++文件读取与写入,而且使用二进制方式
C++/Qt文件写入读取速度比较
【背景】关于项目读写文件数据,尤其时读写大数据时,特别费时,今天做了个测试 【资源大小】91.2MB的数据 out数据 【方法】 C++: 采用ofstream Qt: 采用QFile+QTextStream   C++写入数据 QTime m_time; ofstream ofs(&quot;D:/Projects/01-Sar/Sar/Sar/textC++.tx...
Qt从网络读取数据写入本地二进制文件
发送请求: QNetworkRequest request(url); if (m_ReqQueue.isEmpty()) { m_NetAccessManager.get(request); } m_ReqQueue.append(request); m_ReqQueue是一个队列,没有实际意义。 接收数据在回调中: QFile tmpFil
文件读写~二进制文件之bmp文件信息
关于二进制的文件读写。
Qt读取以16进制存储的二进制文件
首先清楚二进制文件常见格式 .bin .hex 读取方法使用Qt File 打开 然后使用QDataStream进行读取文本文件常见格式 .txt读取方法使用Qt File 打开 然后使用QTextStream进行读取源码QString fileName = QFileDialog::getOpenFileName(this,tr(&quot;Open File&quot;),QDir::currentPath(),...
二进制文件读取问题
下面是读取二进制文件时存储的结构体rnrn[code=vb]Public Type netBaseParamStructure rn bytIP(0 To 1, 0 To 3) As Byte '0 To 1:A网口和B网口,0 To 3:每个IP地址占用共4个字节rn bytMask(0 To 1, 0 To 3) As Byte '地址掩码rn bytGateWay(0 To 1, 0 To 3) As Byte '网关信息rnEnd TypernPublic NetBaseParam As netBaseParamStructurern[/code]rnrn通过以下代码写入到结构体中rn[code=vb]Fileno = FreeFilern Open filename For Binary As #Filenorn Get #Fileno, , NetBaseParamrn Close #Fileno [/code]rn则通过filename文件得到A网口的ip地址为bytIP(0,0)~bytIP(0,3) 比如192 168 0 1rn 得到B网口的ip地址为bytIP(1,0)~bytIP(1,3) 比如192 168 0 2rnrn但是为什么filename文件里面的二进制(换成10进制看)是 192 192 168 168 0 0 1 2这样的方式存储的 ???rn不应该是192 168 0 1 192 168 0 2 这样存储吗??为什么会交叉呢?难道是先读读入bytIP(0,0),再读入bytIP(1,0)?不是应该先把bytIP(0,0)~bytIP(0,3)读完吗rn
读取二进制文件读取问题?
RArray.dat中保存仰角数,仰角,和R数组的数据,数据以二进制的方式保存,存放顺序rn1)当前仰角层数,类型为4字节整型,长度为4字节rn2)有效层数的仰角,类型为4字节实型,长度为4*仰角层数 字节rn3)R数组数据,类型为4字节实型,长度为4*MaxRads*Gates**仰角层数 字节rn请问我怎么样把这3个数组数据读出来,多谢了!
关于二进制文件读取的问题
由于工作需要从一个二进制文件中,读取一串二进制数据,读取的代码如下:rnrnrnli_File = FileOpen(ls_billname,streamMode!)rnfileseek(li_file,lenrecord,frombeginning!)rnflen=flen -lenrecordrnIF flen > 32765 THENrn IF Mod(flen, 32765) = 0 THENrn loops = flen/32765rn ELSErn loops = (flen/32765) + 1rn END IFrnELSErn loops = 1rnEND IFrnFOR i = 1 to loopsrn ll_pos=FileRead(li_File,lb_read)rn lb_file+= lb_readrn nextrn//loop while ll_pos<0rnfileclose(li_file)rn////写入话单rnloops=integer(len(lb_file)/billlen)rnfor i=1 to loopsrn lb_read=blobmid(lb_file,i+(i -1)*billlen,billlen)rn this.of_savebill(string(lb_read))rnnextrn//记录新位置rnls_pos=string(ll_pos)rnupdate t_base_profile set fvalues1=:ls_pos,fvalues2=convert(char(10),getdate(),121) where fid=1402;rncommit;rnreturnrnrnrnrnrn可是,为什么我只能读出一个字符?rnrn把二进制文件用文本打开后显示如下:“A 82069102 2006-04-03,10:47:08 ;! 82214688 2006-04-03,10:58:29> ”rnrn请问我可以如何解决??
二进制文件读取的问题?
假设二进制文件a.dat中存储一个2个字节的2进制数n,n的值为0XD561,rn本人用如下语句,读取出数值n:rnCFile f;rnf.Open( a.dat, CFile::modeRead, &fileException ))rnrn__int16 nRead;rnf.Read((void*)&nRead,2);rn经过跟踪发现nRead的值为0X61D5,而不是0XD561。不知为什么。并且怎么修改才能达到把n的正确值取出的目的。
二进制文件读取的四个问题
读取二进制文件,该文件中有汉字、英文字母、数字、符号这四种类型rnrnrn第一个问题:rnBinaryReader br = new BinaryReader(brfs, Encoding.GetEncoding("gb2312"));rnEncoding GB = Encoding .GetEncoding ("gb2312");rnrnrn直接读取字符:rnchar[] chbuffer = new char[20];rnchbuffer = br.ReadChars(2);rnrn显示两个汉字:中国,分别存在char[1]和char[2]中rnrnrnrnbyte[] bt = new byte[2];rnbt = br.ReadBytes(2);rnstr = GB.GetString(bt);rn显示一个汉字:中rnrn问题:char类型在二进制文件中占2个字节?我查资料怎么说是C#的char是一个字节rnrnrnrn第二个问题:rn读完“中国”这两个汉字后,接下来是个int的数字,读取方法为:rnrnbt = br.ReadBytes(4);rnstr = GB.GetString(bt);rnConsole.WriteLine(bt.ToString());rnrn显示为:System.Byte[]rnrn为什么不能正确显示数字呢?因为我想数字也是gb2312编码里的一部分啊!rnrnrnrn第三个问题:rn上边的不能正常读取数字,但是这样可以:rnint i = br.ReadInt32();rnConsole.WriteLine(i.ToString());rn不知道为什么?rnrn我的理解:Binaryreader.readint32是先调用binaryreader.readbyte(4),再用“gb2312”进行编码,不知道我理解的对不对?rnrnrnrn第四个问题:rn关于FileStream 和BinaryReader 的关系,如下:rnrnFileStream brfs = File .OpenRead (BinAdd );rnBinaryReader br = new BinaryReader(brfs);rnrn可不可以这样理解:BinaryReader 是建立在FileStream 的基础之上的,当BinaryReader.ReadInt32()之后,用FileStream.Seek()对文件流的当前位置进行重新设置,往前挪4个字节,那么再次执行BinaryReader.ReadInt32(),是否所读结果和前一次的BinaryReader.ReadInt32()所读数据一样?
文件读写操作工具类CProcessFile
1.检测文件路径,如果文件不存在则创建路径 a. void ProcessFile::CheckDirectory(CString path) { //if (!PathFileExists(path)) { ProcessFile::createMultiDir(path); } } b. bool ProcessFile::createMultiDir(const wch...
二进制文件读取速度问题?
二进制文件读取速度问题?rnrn1、如果一个目录下有多个二进制文件,假设有一万个,我读取其中的一个会不会因文件多而变慢,如变慢会变慢多少rn2、通过函数读取流数据,再赋给类的成员变量,会降底多少速度rn int i =ReadInt();rn char c = ReadChar();rn3、每个读取函数如ReadInt()中都有一个判断语句 if (bPrintError),会影响多少速度rn4、new 的类实体对速度的影响大吗,请多指导
请教二进制文件读取的问题!
在读二进制文件的时候怎么结束啊?rn如:rnArrayList str=new ArrayList();rnFileStream stm=new FileStream(filename,System.IO.FileMode.Open);rnBinaryReader stmr=new BinaryReader(stm);rn rnwhile(true)rnrn tryrn rn string temp=stmr.ReadString();rn if (temp!="")rn str.Add(temp);rn rn catch (EndOfStreamException err)rn rn break;rn rn rn stm.Close();rn stmr.Close();rnrn我是通过引发异常跳出循环的!肯定是不好了!能不能有其它的方法让循环终止啊?rn谢谢!
二进制文件读取及定位的问题
二进制文件,我是这样读取并定位的rn FileStream fs = File.OpenRead("F:\\2009年工作\\LACBL2");rn BinaryReader br = new BinaryReader(fs);rn Byte[] wellname = new byte[100];rn br.BaseStream.Read(wellname, 84, 8);rn可是读出来的是“System.Byte[]”,并不是我想要的结果,请问这是怎么回事? rnrn
求教,二进制文件读取问题?
请问,有这样一个二进制文件rn 人名 字符 14 字母,数字的ASCⅡ码值减去32后保存rn 年龄 双字节数 2 rn 成绩 单字节数 1rn如何读取这种格式的文件,怎么转换呢,请指教? rn
Qt读取苹果系统OSX上的plist资源文件
http://blog.csdn.net/u014597198/article/details/52672727 先讲一下整体流程: 1、先在X-Code上创建.h和.mm文件,并写出主要读取资源文件函数和接口 2、把.h和.mm文件添加到Qt中,并写出C++间接调用接口 3、把界面和调用读取plist资源文件接口联系起来 对于MAC上的应用软件的
二进制文件读取?
有一二进制文件格式如下:rn rn typedef struct tagGridDataFileHeaderrn rn short nDataType; //资料类型,2个字节rn CTime tSourceDataStartTime;//源数据的开始时间信息,对于预报结果文件,该值是最后一个实测数据的开始时间信息,4个字节rn CTime tSourceDataEndTime;//源数据的结束时间信息,对于预报结果文件,该值是最后一个实测数据的开始时间信息,4个字节rn int nMinutes;//预警时间长度信息(分钟),对于实测数据,该值为0,4个字节rn float fGridDataLeftLongitude;//左边的经度(度),4个字节rn float fGridDataTopLatitude;//上边的纬度(度),4个字节rn float fGridDataCenterLongitude;//中心经度(度),4个字节rn float fGridDataCenterLatitude;//中心纬度(度),4个字节rn float fGridDataDeltaX;//横向格距(KM),4个字节rn float fGridDataDeltaY;//纵向格距(KM),4个字节rn int nGridDataXNum;//横向格点数,4个字节rn int nGridDataYNum;//纵向格点数,4个字节rn short nType;//产品的类型,2个字节,0为实测数据的格点化产品,1为预警产品rn float fTemp[10];//备用数据,40个字节rnrn rn rnrn我现在想把它一一读出显示在文本中,我试按以下写,却写不下去,该怎么写?谢谢了!rn rn string StrTxtFileName = @"F:\DFPP200909221610.DAT";rn FileStream fs = new FileStream(StrTxtFileName, FileMode.Open);rn BinaryReader rdr = new BinaryReader(fs);rn rn Console.WriteLine(rdr.ReadUInt16().ToString());//读nDataType数据rn //读时间数据???tSourceDataStartTimern //fs.Position += 10;rn rnrn fs.Dispose();rn fs.Close();rn rdr.Close();
二进制文件读取
一个二进制文件,为BYTE型数据,如何读出?在线等待,谢谢
二进制文件读取?
文件头格式:rn4字节 XX数量 (数值为86)rn4字节 YY数量 (数值为90)rn4字节 ZZ数量 (数值为68)rn4字节 TT数量 (数值为2)rn4字节 hh步长 (数值为10)rn紧接是28个XX名称 每个XX名占10个字节rn我怎么样提取28个XX的名称,并一一显示出来,还有ZZ的数量值即68显示出来?还有能否把这二进制文件转换成文本文件以便查看?rnrn
文章热词 机器学习教程 Objective-C培训 交互设计视频教程 颜色模型 设计制作学习
相关热词 mysql关联查询两次本表 native底部 react extjs glyph 图标 qt物联网教程 qt教程python