http://hi./xzmhenry/blog/item/://zhidao./question/ 2个text mand 2个timer 其他属性根据自己喜欢再设计PublicaAsInteger,mand1_Click() a= b= Ifa>23Orb>59ThenMsgBox("输入有误,请重新输入") =True ="你要关机的时间是"&a&"时"&b&"分"mand2_Click() EndEndSubPrivateSubForm_Load() ="确定" ="停止" ="时" ="分" ="关机时间为:" ="等待......" ="" ="" =False =True =1000 =1000EndSubPrivateSubText1_KeyPress(KeyAsciiAsInteger) IfKeyAscii=8ThenExitSub IfKeyAscii>57OrKeyAscii<48ThenKeyAscii=0EndSubPrivateSubText2_KeyPress(KeyAsciiAsInteger) IfKeyAscii=8ThenExitSub IfKeyAscii>57OrKeyAscii<48ThenKeyAscii=0EndSubPrivateSubTimer1_Timer() <= =-200 IfHour(Time)=aAndMinute(Time)=bThen =False Shell("c:\windows\system32\") EndIfEndSubPrivateSubTimer2_Timer() Print"现在时间是:"&TimeEndSub关于本程序问题:网友评论:1网友:天涯2008-04-0417:17这个代码怎么不能关机啊!我的邮箱请回复:millionhome@ 2xzmhenry2008-04-1517:36你再仔细查一下编码看应该没问题的我有同学现在也在用这个饿你看下是不是Shell("c:\windows\system32\")你的系统的盘符看下是不是C盘看 VB编写定时关机2007年06月15日星期五12:50'其中声明API放在模块中了,有需要的可以留言给我,mand1_Click() =""OrFenZhon
关机代码 来自淘豆网www.taodocs.com转载请标明出处.