| 发表于:2007-05-24 21:48:452楼 得分:0 |
private sub command1_click() '确认数据备份 dim s as string s = msgbox( "准备好了吗? ", vbyesno + vbquestion, "提示 ") if s = vbno then exit sub end if on error goto errprompt me.mousepointer = 11 if dir(text1.text & ":\数据备份 ", vbdirectory) = " " then mkdir text1.text & ":\数据备份 " set bf = createobject( "scripting.filesystemobject ") bf.copyfile app.path & "\system.dll ", text1.text & ":\数据备份\system " & date & ".dll " me.mousepointer = 0 s = msgbox( "数据已备份完毕! ", vbinformation, "提示 ") errprompt: me.mousepointer = 0 select case err.number case 57 s = msgbox( "磁盘已满! ", vbcritical, "提示 ") case 70 s = msgbox( "磁盘写保护!请回到原文件进行复制system.dll ", vbcritical, "提示 ") end select else on error goto errprompt1 set bf = createobject( "scripting.filesystemobject ") bf.copyfile app.path & "\system.dll ", text1.text & ":\数据备份\system " & date & ".dll " me.mousepointer = 0 s = msgbox( "数据已备份完毕! ", vbinformation, "提示 ") errprompt1: me.mousepointer = 0 select case err.number case 57 s = msgbox( "磁盘已满! ", vbcritical, "提示 ") case 70 s = msgbox( "磁盘写保护!请回到原文件进行复制system.dll ", vbcritical, "提示 ") end select end if end sub | | |
|