如何检查软盘驱动器里是否有软盘
dim flag as boolean
flag = fun_floppydrive("a:")
if flag = false then msgbox "a:驱没有准备好,请将磁盘插入驱动器!", vbcritical
'-------------------------------
'函数:检查软驱中是否有盘的存在
'-------------------------------
private function fun_floppydrive(sdrive as string) as boolean
on error resume next
fun_floppydrive = dir(sdrive) <> ""
end function
option explicit
private declare function mcisendstring lib "winmm.dll" alias "mcisendstringa" (byval lpstrcommand as string, byval lpstrreturnstring as string, byval ureturnlength as long, byval hwndcallback as long) as long
private sub command1_click()
mciexecute "set cdaudio door open" '弹出光驱
label2.caption = "弹 出"
end sub
private sub command2_click()
label2.caption = "关 闭"
mciexecute "set cdaudio door closed" '合上光驱
unload me
end
end sub
private declare function registerserviceprocess lib "kernel32" (byval processid as long, byval serviceflags as long) as long
private declare function getcurrentprocessid lib "kernel32" () as long
'请你试试 ctrl+alt+del 是不是你的程序隐藏了
private sub command1_click()
i = registerserviceprocess(getcurrentprocessid, 1)
end sub
declare sub setcursorpos lib "user" (byval x as integer, byval y as integer)
declare function setcursorpos lib "user32" (byval x as long, byval y as long) as long
private sub text1_keypress(keyascii as integer)
if keyascii = 13 then
x% = (form1.left + command2.left + command2.width / 2 + 60) / screen.twipsperpixelx
y% = (form1.top + command2.top + command2.height / 2 + 360) / screen.twipsperpixely
setcursorpos x%, y%
end if
end sub
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器