ÁíÀà¼ì²âÁªÍø״̬
¸Ã³ÌÐòµÄ¾ÖÏÞÐÔ£ºÍ¨¹ý´úÀí·þÎñÆ÷ÉÏÍøÎÞЧ£»ÐÂÀ˼°ÉîÛÚÖ®´°Í¬Ê±¹ØÃŴ󼪻òͬʱ¸ü¸ÄÓòÃû±¾³ÌÐòÎÞЧ£¨²»¹ýÄã¿Éͨ¹ý¸ü¸ÄpingµÄ¶ÔÏóÀ´±ÜÃ⣩¡£ ·µ»Øping½á¹ûÎҵĻúÆ÷É趨Ϊ3Ã룬Èç¹ûÌáʾÎļþ²»´æÔÚ£¬ÄǾÍÒªÔÙÑÓ³¤Ê±¼ä£¬¸Ä³É4»ò5Ãë:¾ÍÊǸÄÕâÒ»¾ä£ºMe.TimerInterval = 3000 1¡¢ÏÈÔÚCÅ̽¨Á¢Ò»¸öÃûΪInternetTest.batµÄÎļþ£¬ÎļþÄÚÈÝΪ£º ping www.sina.com.cn > c:\sina.txt ping www.szptt.net.cn > c:\szptt.txt 2¡¢ÔÚÓÃÀ´¼ì²âÁªÍø״̬µÄ´°ÌåÀïÀï·ÅÈëÒÔÏ´úÂ룺 Private Sub Form_Load() Dim a 'ÓÃDOSÅúÃüÁî°ÑPING½á¹û±£´æÔÚÏà¹ØTXTÎļþÀï a = Shell("c:\InternetTest.bat", vbHide) '3ÃëºóÖ´ÐÐÅжϣ¬ÒòΪPINGÒ»¸öµØÖ·´ó¸ÅÐèÒªÕâô³¤Ê±¼ä£¬Èç¹û²»µÈ´ý£¬½«»á³ö´í Me.TimerInterval = 3000 End Sub Private Sub Form_Timer() Dim SinaTest, SzpttTest As String * 7 '´ò¿ªÏà¹ØTXTÎļþ Open "c:\sina.txt" For Input As #1 Open "c:\szptt.txt" For Input As #2 'TXTÎļþµÄÍ·7¸ö×Ö·û¶Áµ½Ïà¹Ø±äÁ¿ÖÐ If Not EOF(1) Then SinaTest = Input(7, #1) End If If Not EOF(2) Then SzpttTest = Input(7, #2) End If '¹Ø±Õ´ò¿ªµÄTXTÎļþ Close #1 Close #2 'ɾ³ýÏà¹ØµÄTXTÎļþ Kill "c:\sina.txt" Kill "c:\szptt.txt" 'ÅжÏÊÇ·ñÁªÍø If SinaTest = "Unknown" And SzpttTest = "Unknown" Then MsgBox "ÄãûÓÐÁªÉÏ»¥ÁªÍø" Else MsgBox "ÄãÒѾÉÏÍø" End If '¹Ø±Õ¼ÆʱÆ÷ Me.TimerInterval = 0 End Sub
--------------------------------------------------------------------------------
Ïà¹ØÎÄÕÂ
´óÐÍÊý¾Ý¿âÉè¼ÆÔÔò 2003-12-15 12:49:18
ROSE¼¼Êõ°×ƤÊé 2003-12-15 12:34:14
Á˽â Microsoft Access °²È«ÐÔ 2003-11-13 11:21:08
²»µ±±àдSQLÓï¾äµ¼ÖÂϵͳ²»°²È« 2003-11-13 10:55:26
ÈçºÎÕï¶Ï/ÐÞ¸´Ëð»µµÄ Jet 4.0 Êý¾Ý¿â 2003-10-14 8:31:26
Æô¶¯¿ØÖÆÃæ°åÃüÁî´óÈ« 2003-10-10 10:21:08
Êý¾Ý¿âÓ¦ÓóÌÐòÐè×¢ÒâµÄÎÊÌâ 2003-10-6 11:11:06
|