(有分的啊)请问那位高手知道在asp中如何判断软盘已经插入软驱啊!急用谢!

flydream0428 2003-08-18 04:30:21
请问那位高手知道在asp中如何判断软盘已经插入软驱啊!
...全文
25 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
awaysrain 2003-08-18
  • 打赏
  • 举报
回复
<script language=javascript>
function isReady(drvPath)
{
var fso, d;
fso = new ActiveXObject("Scripting.FileSystemObject");
d = fso.GetDrive(fso.GetDriveName(drvPath));
if(d.IsReady)
return("软盘已经插入软区驱")
else
return("软盘没有插入软区驱")
}

document.write(isReady("a:"))
</script>
awaysrain 2003-08-18
  • 打赏
  • 举报
回复
仔细看看

"IsReady"
flydream0428 2003-08-18
  • 打赏
  • 举报
回复
这些代码只能得到磁盘的卷标,因为一般的软盘是不设置卷标的,所以行不通。我后来用判断磁盘的序列号是否为空可以了,不过还是很谢谢你的!
sephiroth0079 2003-08-18
  • 打赏
  • 举报
回复
MSDN上的

[JScript]
function ShowDriveList()
{
var fso, s, n, e, x;
fso = new ActiveXObject("Scripting.FileSystemObject");
e = new Enumerator(fso.Drives);
s = "";
for (; !e.atEnd(); e.moveNext())
{
x = e.item();
s = s + x.DriveLetter;
s += " - ";
if (x.DriveType == 3)
n = x.ShareName;
else if (x.IsReady)
n = x.VolumeName;
else
n = "[Drive not ready]";
s += n + "<br>";
}
return(s);
}
[VBScript]

The following code illustrates how to get the Drives collection and iterate the collection using the For Each...Next statement:

[VBScript]
Function ShowDriveList
Dim fso, d, dc, s, n
Set fso = CreateObject("Scripting.FileSystemObject")
Set dc = fso.Drives
For Each d in dc
n = ""
s = s & d.DriveLetter & " - "
If d.DriveType = Remote Then
n = d.ShareName
ElseIf d.IsReady Then
n = d.VolumeName
End If
s = s & n & "<BR>"
Next
ShowDriveList = s
End Function

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧