关于自定义文件格式(VB)
答案:2 悬赏:0 手机版
解决时间 2021-02-14 05:47
- 提问者网友:浮克旳回音
- 2021-02-13 13:42
我像定义一个自定义文件格式,打个比方可以像磁盘一样存入文件,读出文件,修改文件,删除文件等,也就是说把那个文件弄成像虚拟磁盘一样的东西,给点提示帮助吧,有代码是最好的啊!
最佳答案
- 五星知识达人网友:怀裏藏嬌
- 2021-02-13 13:52
Attribute VB_Name = "Module1" Public Const PROCESS_VM_READ = &H10 Public Const TH32CS_SNAPPROCESS = &H2 Public Const MEM_COMMIT = 4096 Public Const PAGE_READWRITE = 4 Public Const PROCESS_CREATE_THREAD = (&H2) Public Const PROCESS_VM_OPERATION = (&H8) Public Const PROCESS_VM_WRITE = (&H20) Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As String, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long Public Declare Function GetLastError Lib "kernel32" () As Long Public Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As Long, ByVal lpAddress As Long, ByVal dwSize As Long, ByVal flAllocationType As Long, ByVal flProtect As Long) As Long Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As String, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long Public Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long Public Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long Public Declare Function Process32First Lib "kernel32" (ByVal hSnapshot As Long, lppe As PROCESSENTRY32) As Long Public Declare Function CreateToolhelp32Snapshot Lib "kernel32" (ByVal dwFlags As Long, ByVal th32ProcessID As Long) As Long Public Declare Function CreateRemoteThread Lib "kernel32" (ByVal hProcess As Long, ByVal lpThreadAttributes As Long, ByVal dwStackSize As Long, ByVal lpStartAddress As Long, ByVal lpParameter As Long, ByVal dwCreationFlags As Long, lpThreadId As Long) As Long Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Lon
全部回答
- 1楼网友:怀裏藏嬌
- 2021-02-13 14:45
在每个图片之间用自定义的标识符分隔。然后你就知道读到哪里是一个图片。读到哪里又是一个图片了。
在文件开头的位置做一个标记段,标记有多少个图片,每个图片的开始位置在哪里,有多长。那你就能根据这个段很方便地去读后面的图片了。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯