最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
asp filesystemobject 文件系统例子
时间:2022-06-30 11:41:23 编辑:袖梨 来源:一聚教程网
<%
set fs=server.createobject("scripting.filesystemobject")
if (fs.fileexists("c:windowscursorsxxx.cur"))=true then
response.write("文件 c:windowscursorsxxx.cur 存在。")
else
response.write("文件 c:windowscursorsxxx.cur 不存在。")
end if
set fs=nothing
%>
<%
set fs=server.createobject("scripting.filesystemobject")
if fs.folderexists("c: emp") = true then
response.write("文件夹 c: emp 存在。")
else
response.write("文件夹 c: emp 不存在。")
end if
set fs=nothing
%>
<%
set fs=server.createobject("scripting.filesystemobject")
if fs.driveexists("c:") = true then
response.write("驱动器 c: 存在。")
else
response.write("驱动器 c: 不存在。")
end if
response.write("
")
if fs.driveexists("g:") = true then
response.write("驱动器 g: 存在。")
else
response.write("驱动器 g: 不存在。")
end if
set fs=nothing
%>
由于fso对象包含在scripting 类型库 (scrrun.dll)中,所以在使用前首先需要在在工程中引用这个文件,单击“工程”,“引用”,然后在“引用”对话框中选中“microsoft scripting runtime”前的复选框,然后单击“确定”。
要创建fso对象可以采用两种方法,一种是将一个变量声明为fso对象类型:dim fsotest as new filesystemobject;另一种是通过createobject方法创建一个fso 对象:set fsotest = createobject(“scripting.filesystemobject")。在实际使用中具体采用哪种声明方法,可根据个人的使用习惯而定。
完成了fso对象模型的创建之后,就可以利用创建的对象模型的方法访问下属各个对象的属性来获取所需信息或进行相关操作了,具体的方法在下面结合各个对象分别讲述
相关文章
- 《一耽女孩》官网入口地址直达 12-21
- 蓝莓影院官网最新入口-2026蓝莓影院电视剧全网免费观看 12-21
- 阿里旺旺网页版在线登录入口-阿里旺旺网页版官方唯一在线入口 12-21
- 学习通网页版登录入口 学校通官方免费在线使用指南 12-21
- 抖币充值官网入口-抖音1:10比例抖币直充链接 12-21
- 百度云盘网页版直达入口-百度网盘网页版快捷登录入口 12-21