最新下载
热门教程
- 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对象模型的创建之后,就可以利用创建的对象模型的方法访问下属各个对象的属性来获取所需信息或进行相关操作了,具体的方法在下面结合各个对象分别讲述
相关文章
- 女神漫画免费下载最新版本动漫入口页面-女神漫画在线观看安装包动漫入口 02-08
- 哔哩哔哩b站官网直达-bilibili网站主页一键进入 02-08
- 365日历网页版快捷登录-365日历网页版一键登录入口 02-08
- 免费看短视频的精品app-追剧无广告的必备app推荐 02-08
- 微信对话生成器-无水印版免费下载 02-08
- 豆包网页版应用生成器-豆包AI应用一键生成 02-08