如何读取具有dvi扩展名的二进制文件 [英] How to read binary file with dvi extension

查看:115
本文介绍了如何读取具有dvi扩展名的二进制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我有一个带有DVI扩展名的二进制文件,我需要在其中获取信息.当然,我可以使用某些应用程序,例如LatexEditor等,但是我想创建自己的应用程序.所以请帮我创建这样的程序.

我用谷歌,但我找不到任何有用的来源.可能是我使用了错误的关键字.
最有可能的资源是你们.

我尝试通过字节流读取它,但这不是一个好主意.
我所做的是

Hi guys. I got a binary file with DVI extension and i need to get the information inside of it. Of course i can use some application such as LatexEditor or something but i want to create my own application. So please help me to create such program.

I used google but i could''nt find any useful source. May be i used wrong key word.
Most Possible resoure is U guys.

I tried read it by byte stream but it wasn''t good idea.
What i did is

FileInfo f = new FileInfo("name.dvi");
BinaryReader br = BinaryReader(f.OpenRead() );
while( br.PeekChar()!= -1)
{
consele.writeline( br.ReadByte() ); // just for check
}



如果有人从事类似的工作,或者知道与二进制文件有关的任何事情,那么请给我一些源代码或库的确切名称.


谢谢你.



If some one who worked something like that or knows any thing ralated to binary file then pls give me some source code or exact name of library.


Thank u.

推荐答案

阅读起来很容易,File.ReadAllBytes可以做到这一点.我认为您的意思是从文件中获取信息.为此,如果可以在任何地方找到记录的文件格式,或者只是简单地进行处理,就需要阅读文件格式.除非您能找到适合您的库,否则它需要做很多工作.
Reading it is easy, File.ReadAllBytes will do that. I think what you mean is, to get the information out of the file. To do that, you need to read the file format, if you can find it documented anywhere, or just plain work it out. It''s a lot of work, unless you can find a library that does it for you.


T-Joe写道:

请给我适当的答案



克里斯汀·格劳斯(Christian Graus)给了您一个很好的正确答案.我没回音,因为他回答了你的问题很好.我在这里的回答与他的回答相同,但用不同的词来说,补充细节有所不同.您可能需要花费一些时间多次尝试答案,直到您理解为止.

另外,如果您需要修改或更新问题,则可以对其进行编辑.这比添加一个不是答案的答案更合适.




Christian Graus has given you a good proper answer. I didn''t respond before since he answered your question just fine. My answer here is just the same as his, but in different words with some differences in supplemental details. You may need to spend some time working your way through the answer multiple times until you understand it.

Also, if you need to modify or update your question, you can edit it. That is more appropriate than adding an answer that isn''t one.


T-Joe写道:

我尝试按字节流读取,但它给了我一些数字.

I tried read by byte stream but it gave me some numbers.


完全正确,也正是您尝试之前应该期望的.所有的所有文件都是一些数字.诀窍在于解释它们所代表的含义.为此,您需要处理的文件类型以及它如何表示事物.您的.DVI文件可能是Action Media II数字视频互动电影.它可能是与TeX设备无关的文档.可能完全不同.您,T-Joe,需要首先确定这一点.然后,您,T-Joe,将需要研究并收集有关该文件类型的信息.如果您非常幸运,可以提出一个文件格式规范.您可能最终尝试对格式进行反向工程.您可能会找到可以使用的库-这将是最有效的方法.

仅凭猜测,但仅凭猜测,您可能正在处理TeX设备独立文档.如果是这种情况,那么当您(T-Joe)在研究工作中使用Google时,您会发现很多有关它的信息.您甚至会使用C打开源代码(尽管我不希望您在C#中找到很多东西,如果有的话).您甚至可以找到类似的信息 [


That is exactly right and that is exactly what you should have expected before you tried it. All any file is, is some numbers. The trick is interpreting what they represent. For that you need to what type of file you are dealing with and how it represents things. Your .DVI file might be an Action Media II Digital Video Interactive Movie. It might be a TeX Device Independent Document. It might be something totally different. You, T-Joe, need to determine this first. Then you, T-Joe, will need to research and gather information about that file type. If you are exceedingly fortunate you may turn up a file format specification. You may end up trying to reverse engineer the format. You might find a library you can use - this would be the most effective possibility.

At a guess, but only a guess, it is likely that you are dealing with TeX Device Independent Documents. If this is the case, then you will find lots of information about it when you, T-Joe, use google in your research efforts. You will even turn up source code in C (though I don''t expect you to find much, if any, in C#). You will even find information like this[^]. Then you will have to leave your sleeves rolled up :-D (you did roll them up to use Google, no?) and apply your elbow grease to the problem you have undertaken.


这篇关于如何读取具有dvi扩展名的二进制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆