vb ´´½¨¿ì½Ý·½Ê½ ¼æÈÝvista XP
'´´½¨¿ì½Ý·½Ê½£¬¼æÈÝvista
'Òª°Ñvb6stkit.DLL·Åµ½³ÌÐòĿ¼
'°½Ê¿Î° 09-10-27
'Ö»¶Ô“×ÀÃ攺͓¿ªÆô”ÓÐЧ£¬ÆäËü»¹Ã»×ö
'=========¿ªÆôÍⲿͬ²½³ÌÐò¶¨Ò忪ʼ
Const SYNCHRONIZE = &H100000
Const INFINITE = &HFFFF 'Wait forever
Const WAIT_OBJECT_0 = 0 'The state of the specified object is signaled.
Const WAIT_TIMEOUT = &H102 'The time-out interval elapsed, and the
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
'=========¿ªÆôÍⲿͬ²½³ÌÐò¶¨Òå½áÊø
'´´½¨¿ì½Ý·½Ê½
Private Declare Function fCreateShellLink Lib "vb6stkit.DLL" ( _
ByVal lpstrFolderName As String, _
ByVal lpstrLinkName As String, _
ByVal lpstrLinkPath As String, _
ByVal lpstrLinkArgs As String, _
ByVal fPrivate As Long, _
ByVal sParent As String) As Long
'
'lpstrFolderName Îļþ¼ÐµÄÃû³Æ “$(proprams)” ³ÌÐò×é "$(Strar Menu)" ¿ªÊ¼²Ëµ¥
'lpstrLinkName ¿ì½Ý¼üµÄÃû³Æ
'
'lpstrLinkPath ¿ì½Ý¼üµÄ·¾¶
'
'lpstrLinkArgs ÕâÀïÊÇÃüÁîÐвÎÊý
'
'fPrivate True
'
'sParent ÉÏÒ»²ãÎļþ¼Ð
'¿ì½Ý·½Ê½Öеij£Êý
Public Enum ShortCutPosition
vbDesktop = 1 '×ÀÃæ
vbStart = 2 'Æô¶¯Ïî
vbStartMenu = 3 '¿ªÊ¼²Ëµ¥³ÌÐòÏî
vbGroup = 4 '¿ªÊ¼²Ëµ¥¶¥¶Ë
End Enum
'¿ªÆôÍⲿͬ²½³ÌÐò¹ý³Ì
Private Sub cmdShell(s_cmd As String)
Dim lPid As Long
Dim lHnd As Long
Dim lRet As Long
lPid = Shell(s_cmd, vbNormalFocus)
If lPid <> 0 Then
lHnd = OpenProcess(SYNCHRONIZE, 0, lPid) 'Get a handle to the shelled process.
If lHnd <> 0 Then 'If successful, wait for the
lRet = WaitForSingleObject(lHnd, INFINITE) ' application to end.
CloseHandle (lHnd)
Ïà¹ØÎĵµ£º
·ÖÀࣺVBѧϰ ×ֺţº ´ó´ó ÖÐÖРСС mid(×Ö·û´®£¬´ÓµÚ¼¸¸ö¿ªÊ¼£¬³¤¶È) ÔÚ[×Ö·û´®]ÖÐ[´ÓµÚ¼¸¸ö¿ªÊ¼]È¡³ö[³¤¶È¸ö×Ö·û´®]
ÀýÈç mid("СÐÀÎÞµÐ",1,3) Ôò·µ»Ø "СÐÀÎÞ"
instr(´ÓµÚ¼¸¸ö¿ªÊ¼,×Ö·û´®1,×Ö·û´®2) ´Ó¹æ¶¨µÄλÖÿªÊ¼²éÕÒ£¬·µ»Ø×Ö·û´®2ÔÚ×Ö·û´®1Öе ......
VB
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
MSComm1.CommPort = i1
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InBufferCount = 0
& ......
http://zhidao.baidu.com/question/84802747.html
VBÈçºÎ»ñÈ¡´°¿ÚµØÖ·À¸ÄÚÈÝ
¾ÍÊDZÈÈçÎÒ´ò¿ªDÅ̵ÄaaaÎļþ¼Ð£¬´°¿ÚµØÖ·À¸¾ÍÊÇÏÔʾD:\aaa£¬ÇëÎÊÎÒÒªÔõôÓÃVBд³ÌÐòÀ´»ñÈ¡´°¿ÚµØÖ·À¸µÄÄÚÈÝ£¿£¨²»ÊÇIEµÄµØÖ·À¸£©
Èô´ò¿ªÁËÁ½¸ö´°¿Ú£¬±ÈÈçDÅ̵ÄaaaÎļþ¼ÐºÍEÅ̵ÄbbbÎļþ¼ÐϵÄcccÎļþ¼Ð¶¼´ò¿ªµÄ»°£¬µã»÷command1,text1¾ÍÏÔʾ£º
......