end
begin mscomdlg.commondialog cdgfindfile
left = 3060
top = 90
_extentx = 847
_extenty = 847
_version = 393216
end
end
attribute vb_name = "frmmain"
attribute vb_globalnamespace = false
attribute vb_creatable = false
attribute vb_predeclaredid = true
attribute vb_exposed = false
option explicit
private declare function shbrowseforfolder _
lib "shell32.dll" alias "shbrowseforfoldera" _
(lpbrowseinfo as browseinfo) as long
private declare function shgetpathfromidlist _
lib "shell32.dll" _
(byval pidl as long, _
pszpath as string) as long
private type browseinfo
howner as long
pidlroot as long
pszdisplayname as string
lpsztitle as string
ulflage as long
lpfn as long
lparam as long
iimage as long
end type
private fnum as integer
private function showdir(mehwnd as long, _
dirpath as string, _
optional title as string = "请选择文件夹:", _
optional flage as long = &h1, _
optional dirid as long) as long
dim bi as browseinfo
dim tempid as long
dim tempstr as string
tempstr = string$(255, chr$(0))
with bi
.howner = mehwnd
.pidlroot = 0
.lpsztitle = title + chr$(0)
.ulflage = flage
end with
tempid = shbrowseforfolder(bi)
dirid = tempid
if shgetpathfromidlist(byval tempid, byval tempstr) then
dirpath = left$(tempstr, instr(tempstr, chr$(0)) - 1)
showdir = -1
else
showdir = 0
end if
end function
private function operatefile(byval vfile as string, _
byval vsplit as boolean _
) as long
dim itemsize as long
dim filesize as long
dim readsize as long
dim i as long
dim varr() as byte
dim fnum2 as integer
dim filename as string
dim splitfiles as long
if vsplit then
'合并
itemsize = cmbsplitsize.itemdata(cmbsplitsize.listindex)
'取得当前选择的分析尺寸.
redim varr(1 to itemsize) as byte
'重定义缓冲数组.
filename = right(vfile, instr(strreverse(vfile), "\") - 1)
'取得文件名.
fnum = freefile()
open vfile for binary as fnum
filesize = lof(fnum)
'取得文件大小
while filesize > 0
readsize = itemsize