关于ReadAllBytes()函数的困惑 [英] Confusion about ReadAllBytes() Function

查看:1156
本文介绍了关于ReadAllBytes()函数的困惑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友.

昨天,我使用了VB 2008的ReadAllBytes()函数并选择一个文件"Students.mdb"来读取其所有字节. (请注意,此文件不受密码保护,这是MS Access 2003的文件.)然后,我将所有字节存储在Byte数组中.然后,我为该文件("Students.mdb")分配密码,并使用ReadAllBytes()函数再次读取所有字节并将其存储在另一个Byte数组中.
但是,当我比较这两个数组时,我没有发现这两个数组的任何字节之间有任何区别.两个数组的每个字节都相同.这意味着两个数组都相同.那么,那个密码的字节去了哪里?

我不明白这种情况.在我将密码分配给文件时,两个数组的某些字节之间应该有一些区别.但这没有发生.
可以解释一下吗?

等待令人满意的答案.

Dear Friends.

Yesterday, I used the ReadAllBytes() Function of VB 2008 and Select a File "Students.mdb" to read all of its bytes. (Note that this file was not Password Protected and this was a file of MS Access 2003) Then I Stored all the bytes in a Byte array. Then I assign password to this file ("Students.mdb") and again read and Store all its bytes in another Byte array using ReadAllBytes() Function.

But When I compared these two arrays, I did not find any difference between any byte of these two arrays. Each byte of both arrays was same. It Means that Both array were same. So, Where did the bytes of that Password went?

I can''t understand this situation. In my thinking when I assigned the password to the file, there should be some difference between some bytes of both arrays. But It did not happen.
Can some one Explain it?

Waiting for a satisfactory answer.

推荐答案

我不确定这是否适用,并且我对MDB文件一无所知.但是,Windows文件上有一个名为文件流 [ ^ ],这允许额外附加到文件的信息,而不会成为普通数据流的一部分.可能是Access使用此功能来防止正常读取数据时看到密码.
I am not sure that this will apply, and I don''t know anything about MDB files. However, there is a feature on Windows files called File Streams[^], which allow extra information to be attached to a file, without it becoming part of the normal data stream. It may be that Access uses this feature to prevent the password from being seen by a normal read of the data.


尝试从命令行使用 fc/b 在两个mdb文件上(一个带有密码,另一个没有密码).如果两个文件相同,则出问题了,或者您对错误的文件应用了密码.
Try using fc /b from the command line on the two mdb files (the one with the password and the one without). If the two files are identical, then something went wrong or you applied a password to the wrong file.


这篇关于关于ReadAllBytes()函数的困惑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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