特定的文档存有吗?
本例演试怎样最先建立FileSystemObject目标,随后应用FileExists方式来检测某文档是不是存有。
本实例编码以下:
下列为引入的內容:
html
body
%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If (fs.FileExists("c:\windows\cursors\xxx.cur"))=true Then
Response.Write("文档 c:\windows\cursors\xxx.cur 存有。")
Else
Response.Write("文档 c:\windows\cursors\xxx.cur 不会有。")
End If
set fs=nothing
%
/body
/html
本案例运作結果以下:
文档 c:\windows\cursors\xxx.cur 不会有。
特定的文档夹存有吗?
本例演试怎样应用FolderExists方式检测某文档夹是不是存有。
本实例编码以下:
下列为引入的內容:
html
body
%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If fs.FolderExists("c:\temp") = true Then
Response.Write("文档夹 c:\temp 存有。")
Else
Response.Write("文档夹 c:\temp 不会有。")
End If
set fs=nothing
%
/body
/html
本案例运作結果以下:
文档夹 c:\temp 不会有。
特定的驱动器器存有吗?
本例演试怎样应用DriveExists方式来检测某一驱动器器是不是存有。
本实例编码以下:
下列为引入的內容:
html
body
%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
if fs.driveexists("c:") = true then
Response.Write("驱动器器 c: 存有。")
Else
Response.Write("驱动器器 c: 不会有。")
End If
Response.write(" br ")
if fs.driveexists("g:") = true then
Response.Write("驱动器器 g: 存有。")
Else
Response.Write("驱动器器 g: 不会有。")
End If
set fs=nothing
%
/body
/html
本案例运作結果以下:
驱动器器 c: 存有。
驱动器器 g: 存有。
获得某一特定驱动器器的名字
本例演试怎样应用GetDriveName方式来获得某一特定的驱动器器的名字。
本实例编码以下:
下列为引入的內容:
html
body
%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
p=fs.GetDriveName("c:\windows\cursors\abc.cur")
Response.Write("驱动器器名字是:" p)
set fs=nothing
%
/body
/html
本案例运作結果以下:
驱动器器名字是:c:
获得某一特定相对路径的父文档夹的名字
本例演试怎样应用GetParentFolderName方式来获得某一特定的相对路径的父文档夹的名字。
本实例编码以下:
下列为引入的內容:
html
body
%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
p=fs.GetParentFolderName("c:\winnt\cursors\3dgarro.cur")
Response.Write("c:\windows\cursors\abc.cur 的父文档夹名字是:" p)
set fs=nothing
%
/body
/html
本案例运作結果以下:
c:\windows\cursors\abc.cur 的父文档夹名字是:c:\winnt\cursors
获得文档夹拓展名
本例演试怎样应用GetExtensionName方式来获得特定的相对路径中的最终一个成份的文档拓展名。
本实例编码以下:
下列为引入的內容:
html
body
%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write("文档 3dgarro 的文档拓展名是:")
Response.Write(fs.GetExtensionName("c:\windows\cursors\abc.cur"))
set fs=nothing
%
/body
/html
本案例运作結果以下:
文档 3dgarro 的文档拓展名是:cur
获得文档名
本例演试怎样应用GetFileName方式来获得特定的相对路径中的最终一个成份的文档名。
本实例编码以下:
下列为引入的內容:
html
body
%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write("这一文档名的最终一个成份是:")
Response.Write(fs.GetFileName("c:\windows\cursors\abc.cur"))
set fs=nothing
%
/body
/html
本案例运作結果以下:
这一文档名的最终一个成份是:abc.cur
获得文档或文档夹的基名字
本例演试怎样应用GetBaseName方式来回到在特定的相对路径汉语件或是文档夹的基名字。
本实例编码以下:
下列为引入的內容:
html
body
%
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write(fs.GetBaseName("c:\windows\cursors\abc.cur"))
Response.Write(" br / ")
Response.Write(fs.GetBaseName("c:\windows\cursors\"))
Response.Write(" br / ")
Response.Write(fs.GetBaseName("c:\windows\"))
set fs=nothing
%
/body
/html
本案例运作結果以下:
特定的文档存有吗? 本例演试怎样最先建立FileSystemObject目标,……
1.锚文字的重要词1定要精确1般来讲,自助建网站提升中做內部……
处理互联网要求 传送网站运用应用使用价值咨询资询咨询顾问一……
如今的公司基础都有着自身的网站,企业网站建设做好以后就刚……
免备案空间F型服务器 价钱:160零元/一年320零元/2年 480零元/三年……
简单点来说,便是一个网站适配终端设备。 H5响应式网站能考虑……