自动检测创建多级目录, fso与stream生成文件函数

下面是代码:

%


global_default_root_path






create_directorystrlocalpath
create_directory false

strlocalfolder
strpath tmppath tmptpath
arrpathlist intlevel

strlocalfolder global_default_root_path
strlocalpath strlocalfolder strlocalfolder




strpath strlocalpath strlocalfolder
strpath
strpath strpath strpath


objfolder
objfolder


objfolderfolderexistsstrlocalpath
create_directory true



arrpathlist strpath
intlevel arrpathlist

i
tmptpath
i to intlevel
tmptpath tmptpath arrpathlisti

tmppath strlocalfolder tmptpath
objfolderfolderexiststmppath objfoldercreatefolder tmppath


objfolder nothing
create_directory true








fcreate_filestrfilename byref strcontent
fcreate_file false
strpath
strpath strfilename strfilename -1


create_directorystrpath

forreading forwriting forappending
fso f
fso
f fsoopentextfilestrfilename forwriting true -2
f strcontent
f
fso nothing
f nothing
fcreate_file true








screate_filestrfilename byref strcontent
screate_file false
strpath
strpath strfilename strfilename -1


create_directorystrpath

ado_stream
forreading forwriting
ado_stream

ado_stream

type
Writetextstrcontent
SaveToFile strfilename forwriting
SetEOS


ado_stream nothing
screate_file true

%

你可能感兴趣的:(ASP,stream,function,string,file,server,path)