Latest web development tutorials

ASP GetDriveName method

FileSystemObject Object Reference Complete FileSystemObject Object Reference

GetDriveName method returns a string, the value is the drive name specified path.

grammar

FileSystemObject.GetDriveName(path)

参数 描述
path 必需的。需返回驱动器名称的路径。

Examples

<%
dim fs,dname
set fs=Server.CreateObject("Scripting.FileSystemObject")
dname=fs.GetDriveName("c:\test\test.htm")
Response.Write(dname)
set fs=nothing
%>

输出:

c:


FileSystemObject Object Reference Complete FileSystemObject Object Reference