最新下载
热门教程
- 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对象模型的创建之后,就可以利用创建的对象模型的方法访问下属各个对象的属性来获取所需信息或进行相关操作了,具体的方法在下面结合各个对象分别讲述
相关文章
- Binance.US已上线VIRTUAL 04-30
- binance官网电脑下载_binance苹果版下载地址V2.57.7 04-30
- 比特币交易量最大的交易所是哪个?全球最大的比特币交易平台排名 04-30
- 奥比岛梦想国度卡死闪退有哪些解决方法 04-30
- DNF手游骨戒在哪个位置 04-30
- 回望羊驼:当利空成为短暂的财富密码 04-30