设为首页 | 加入收藏 | 联系站长
Google
 | 星际争霸 | 星际争霸II | 暗黑破坏神
 | 魔兽争霸 | 英雄无敌  
 您现在的位置: 好技术学习网 >> 技术文章 >> ASP技术 >> ASP技术应用 >> 文章正文
相 关 文 章
ASP-MySQL数据库系统的安装…
ASP连接数据库
ADO.NET访问数据库的步骤
ASP.NET 3.5 Extensions带来…
c#.net常用的小函数和方法集
ASP设计常见问题及解答精要…
ASP设计常见问题及解答精要…
Form域中用Post提交容量大的…
ASP中使用组件搜索
解决在ASP中执行数据库查询…
最 新 热 门
最 新 推 荐
精 彩 游 戏
移动能力强,防御强大,任何地方都可以建筑,隐形,多样性,船舶,科技树…
[星际补丁]1.14·1.13f·1.08b
[星际2]酷图 [星际2]人族视频
[人类]大法师  [兽族]暗影猎手
[精灵]恶魔猎手 [不死]死亡骑士
[资讯]魔兽资讯 [图库]魔兽酷图
[下载]魔兽下载 [壁纸]精美壁纸
暗黑破坏神入门 暗黑破坏神指引
[Hero5]宝物一览   英雄无敌
当前时间是:
ASP函数FileSystemObject详解
作者:未知 来源:本站收集 时间:2006-10-23 23:01:08 『 字号:  』

文章系统定位关系

asp函数FileSystemObject详解
Set fs=Server.CreateObject("Scripting.FileSystemObject")
1.文件是否存在
If (fs.FileExists("c:\winnt\cursors\3dgarro.cur"))=true Then
      Response.Write("File c:\winnt\cursors\3dgarro.cur exists.")
Else
      Response.Write("File c:\winnt\cursors\3dgarro.cur does not exist.")
End If
2.目录是否存在
If fs.FolderExists("c:\temp") = true Then
      Response.Write("Folder c:\temp exists.")
Else
      Response.Write("Folder c:\temp does not exist.")
End If
3.磁盘是否存在
if fs.driveexists("c:") = true then
      Response.Write("Drive c: exists.")
Else
      Response.Write("Drive c: does not exist.")
End If

Response.write("<br>")

if fs.driveexists("g:") = true then
      Response.Write("Drive g: exists.")
Else
      Response.Write("Drive g: does not exist.")
End If

4.获得文件所在的磁盘目录
p=fs.GetDriveName("c:\winnt\cursors\3dgarro.cur")
Response.Write("The drive name is: " & p)
结果:c:
5.获得文件所在的文件目录
p=fs.GetParentFolderName("c:\winnt\cursors\3dgarro.cur")
Response.Write("The parent folder name of c:\winnt\cursors\3dgarro.cur is: " & p)
结果:c:\winnt\cursors
6.获得文件的扩展名
Response.Write(fs.GetExtensionName("c:\winnt\cursors\3dgarro.cur"))
结果:cur
7.获得文件全名
Response.Write(fs.GetFileName("c:\winnt\cursors\3dgarro.cur"))
结果:3dgarro.cur
8.获得文件第一个名称
Response.Write(fs.GetBaseName("c:\winnt\cursors\3dgarro.cur"))
Response.Write("<br />")
Response.Write(fs.GetBaseName("c:\winnt\cursors\"))
Response.Write("<br />")
Response.Write(fs.GetBaseName("c:\winnt\"))
结果:3dgarro
        cursors
        winnt
set fs=nothing

  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【打印本文】【关闭窗口

    网站公告 | 关于本站 | 联系站长 | 设为首页 | 加入收藏 | 友情链接 | 版权申明 | 广告服务 | 网站地图 | 访客留言

    Copyright ©
    建议使用1024*768分辨率及第三方浏览器对本站进行浏览
    | |
    本站大部分信息资源来源于网络,仅供学习|研究|探讨|收藏之用,版权归原作者所有!