如果不是网络驱动器,那么 ShareName 属性将返回长度为零的字符串 ("")
<script language="javascript" type=text/javascript>
function ShowDriveInfo(drvpath)
{
var fso, d, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
d = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(drvpath)));
s = d.ShareName;
return(s);
}
var drvpath="y:";//网络驱动器盘符
document.write(ShowDriveInfo(drvpath));
</script>
<script type=text/javascript> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript> </script>
<script language="javascript" type=text/javascript>
function ShowDriveInfo(drvpath)
{
var fso, d, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
d = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(drvpath)));
s = d.ShareName;
return(s);
}
var drvpath="y:";//网络驱动器盘符
document.write(ShowDriveInfo(drvpath));
</script>
<script type=text/javascript> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript> </script>