VBʵÏÖ¡°Ä¾Âí¡±Ê½ÒþÐÎÔËÐгÌÐò
³ÌÐòÒþÐεÄÔÀí
¡¡¡¡¶ÔÓÚÒ»¸öÒþÐγÌÐò¶øÑÔ£¬×î»ù±¾µÄÒªÇóÊÇ£º
¡¡¡¡1. ²»ÔÚ×ÀÃæ³öÏÖ½çÃæ£»
¡¡¡¡2. ²»ÔÚÈÎÎñÀ¸³öÏÖͼ±ê£»
¡¡¡¡3. ³ÌÐòÃû´ÓÈÎÎñ¹ÜÀíÆ÷Ãûµ¥ÖÐÏûʧ¡£
Public Declare Function GetCurrentProcessId Lib “kernel32” () As Long
’»ñµÃµ±Ç°½ø³ÌIDº¯ÊýµÄÉùÃ÷
Public Declare Function RegisterServiceProcess Lib “kernel32” (ByVal ProcessId As Long, ByVal ServiceFlags As Long) As Long
’ÔÚϵͳÖÐ×¢²áµ±Ç°½ø³ÌIDº¯ÊýµÄÉùÃ÷
ÉèÖÃForm1µÄÊôÐÔ£º form1.Visible=False
form1.ShowInTaskBar=False
Private Declare Function GetDriveType Lib “kernel32” Alias “GetDriveTypeA” (ByVal nDrive As String) As Long
’»ñµÃµ±Ç°Çý¶¯Æ÷ÀàÐͺ¯ÊýµÄÉùÃ÷
Private Declare Function GetVolumeInformation Lib “kernel32” Alias “GetVolumeInformationA” (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
’»ñµÃµ±Ç°Çý¶¯Æ÷ÐÅÏ¢º¯ÊýµÄÉùÃ÷
Private Sub Form_Load()
Dim drive_no As Long, drive_flag As Long
Dim drive_chr As String, drive_disk As String
Dim serial_no As Long, kkk As Long
Dim stemp3 As String, dflag As Boolean
Dim strlabel As String, strtype As String£¬strc As Long
RegisterServiceProcess GetCurrentProcessId, 1 ’ ´ÓϵͳÖÐÈ¡Ïûµ±Ç°½ø³Ì
strlabel = String(255, Chr(0))
strtype = String(255, Chr(0))
stemp3 = “172498135” ’ÕâÊÇ×÷ÕßCÅ̵ÄÐòÁкţ¨Ê®½øÖÆ£©,¶ÁÕ߿ɸù¾Ý×Ô¼ºÇé¿ö¸ü¸Ä¡£
dflag = False
For drive_no = 0 To 25
¡¡drive_disk = Chr(drive_no + 67)
¡¡drive_chr = drive_disk & “:\”
¡¡drive_flag = GetDriveType(drive_chr)
¡¡If drive_flag = 3 Then
¡¡¡¡ kkk = GetVolumeInformation(drive_chr, strlabel, Len(strlabel), serial_no, 0, 0, strtype, Len(strtype)) ’ͨ¹ýGetVolumeInformation»ñµÃ´ÅÅÌÐòÁкÅ
¡¡Select Case drive_no
¡¡¡¡
Ïà¹ØÎĵµ£º
¿ªÊ¼Ê¹ÓÃvbµÄʱºòϲ»¶ÓÃÊÖ»³öÄǸö¿Ø¼þµÄλÖÃ.È»ºóÒ»¸öÒ»¸öµÄÍ϶¯,Ò»µãÒ»µãµÄÒÆ¶¯.Ö±µ½¸Ð¾õÂúÒâÁËΪֹ.Èç¹ûÊǿؼþ¶àÁËÕâ¸ö¾ÍºÜÂé·³ÁË
Ò»²»Ð¡ÐÄ¿ÉÄܻὫı¸ö¿Ø¼þÍϵ½Ò»±ßÈ¥
ËùÒÔ,ÎÒÃÇÔÚÒÔºóµÄ×÷Æ·ÖÐ
¾¡Á¿Ê¹ÓôúÂëÀ´¶¨Òå¿Ø¼þλÖÃ,,ÒªÁé»îµÄÕÆÎÕ×ø±êλÖÃ.,¿ÉÒÔʹÓÃ×Ô¶¨Òå×ø±ê.ʹÓÃÏñËØÀ´¸üºÃµÄÀ´·ÖÇøÏÔʾ¿Ø¼þ.
& ......
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Const EWX_LOGOFF = 0
Private Const EWX_SHUTDOWN = 1
Private Const EWX_REBOOT = 2
Private Const EWX_FORCE = 4
Private closeTime As String
Sub AdjustTokenPrivilegesForNT()
......
ÎÄÕÂÀ´Ô´:vb´óÊÀ½ç ×÷ÕߣºÍõ¹úÈÙ
¡¸VB ûÓÐÌṩÕâÑùµÄ¹¦ÄÜ£¬ ±ØÐëºô½Ð Windows API¡¹£¬ µ±±ÊÕßÕâÑù»Ø´ð¶ÁÕßÖ®áᣬÓÐЩ¶ÁÕß»áÒªÇó±ÊÕß½éÉÜ Windows API ·½ÃæµÄÊé¼®£¬ ÓÈÆäÊÇÖÐÎÄÊ飬 µ«Êµ¼ÊÉÏ£¬Ä¿Ç°ÊÐÃæÉÏÖ»¿´µ½Ò»±¾ÔÎÄÊé(ZD Press ³ö°æµÄ Visual Basic 5.0 Programming Guide to Win32 API)£¬ ÖÐÎÄÊéÔòδ¼û¹ý£¬ Ϊʲ÷áÃ»Ó ......
VBÏÔʾ͸Ã÷FLASHЧ¹û
ÑÝʾЧ¹û£º
´úÂëÈçÏ£º
¹«¹²ÉùÃ÷ÇøÓò
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetW ......
×÷Õß: ØýÃû, ¡¡³ö´¦:ITר¼ÒÍø,¡¡ÔðÈαà¼: лåûåû,¡¡
2010-04-23 11:20
¡¡¡¡±¾ÎĽéÉÜVB¶Ô³ÌÐòÔËÐÐµÄ¼à¿Ø¡£
¡¡¡¡×ªÑۼ䣬±¾ÏµÁÐÎÄÕÂÒѾдµ½Á˵ÚÁù¸ö£¬½ñÌìдµãÊ²Ã´ÄØ?
¡¡¡¡»¹ÊǵÃд£¬¿´ËÆVB×ö²»µ½µÄÊÂÇ飬ÄÇô½ñÌìÆð¾ÍддVB¶Ô²Ù×÷ϵͳµÄ¿ØÖưɡ£
¡¡¡¡Ê×ÏÈ£¬ËµÒ»Ëµ£¬VB¶ÔÓÚ±»µ÷ÓúóµÄ³ÌÐòµÄ¼à¿Ø·½·¨¡£
¡¡¡¡ÔÐͺ¯Êý¼ò ......