<
%
MyFolder = server.mappath( " / " )
set fs = createobject ( " scripting.filesystemobject " )
If fs.folderexists(MyFolder) = false then ' 判断文件夹是否存在
fs.createfolder(MyFolder)‘创建文件夹
End If
function getuserspace(blogurl)
path = server.mappath(blogurl)
Set objfso = Server.CreateObject( " Scripting.FileSystemObject " )
Set objFolder = objfso.GetFolder(path)
getuserspace = objFolder.size
Set objFolder = Nothing
endfunction
function fsize(size)
if size < 1000 then
fsize = left (size, 5 ) & " B "
elseif size > 1000 and size < 1024 * 1000 then
fsize = left (size / 1000 , 5 ) & " KB "
elseif size > 1024 * 1000 and size < 1024 * 1024 * 1000 then
fsize = left (size / ( 1024 * 1000 ), 5 ) & " MB "
else
fsize = left (size / ( 1024 * 1024 * 1000 ), 5 ) & " GB "
end if
endfunction
blogspace = getuserspace( " / " )
response.writefsize(blogspace) ' 获取文件夹的大小,并转换单位
file = Server.MapPath( " /ccc.jpg“)
Dim fso,MyFile
Set fso = CreateObject ( " Scripting.FileSystemObject " )
if fso.FileExists(file) then ' 判断文件是否存在
Set MyFile = fso.GetFile(file)
MyFile.Delete’删除文件
end if
MyFolder = server.mappath( " / " )
set fs = createobject ( " scripting.filesystemobject " )
If fs.folderexists(MyFolder) = false then ' 判断文件夹是否存在
fs.createfolder(MyFolder)‘创建文件夹
End If
function getuserspace(blogurl)
path = server.mappath(blogurl)
Set objfso = Server.CreateObject( " Scripting.FileSystemObject " )
Set objFolder = objfso.GetFolder(path)
getuserspace = objFolder.size
Set objFolder = Nothing
endfunction
function fsize(size)
if size < 1000 then
fsize = left (size, 5 ) & " B "
elseif size > 1000 and size < 1024 * 1000 then
fsize = left (size / 1000 , 5 ) & " KB "
elseif size > 1024 * 1000 and size < 1024 * 1024 * 1000 then
fsize = left (size / ( 1024 * 1000 ), 5 ) & " MB "
else
fsize = left (size / ( 1024 * 1024 * 1000 ), 5 ) & " GB "
end if
endfunction
blogspace = getuserspace( " / " )
response.writefsize(blogspace) ' 获取文件夹的大小,并转换单位
file = Server.MapPath( " /ccc.jpg“)
Dim fso,MyFile
Set fso = CreateObject ( " Scripting.FileSystemObject " )
if fso.FileExists(file) then ' 判断文件是否存在
Set MyFile = fso.GetFile(file)
MyFile.Delete’删除文件
end if