VB»ñÈ¡´°¿ÚµØÖ·À¸ÄÚÈÝ
http://zhidao.baidu.com/question/84802747.html
VBÈçºÎ»ñÈ¡´°¿ÚµØÖ·À¸ÄÚÈÝ
¾ÍÊDZÈÈçÎÒ´ò¿ªDÅ̵ÄaaaÎļþ¼Ð£¬´°¿ÚµØÖ·À¸¾ÍÊÇÏÔʾD:\aaa£¬ÇëÎÊÎÒÒªÔõôÓÃVBд³ÌÐòÀ´»ñÈ¡´°¿ÚµØÖ·À¸µÄÄÚÈÝ£¿£¨²»ÊÇIEµÄµØÖ·À¸£©
Èô´ò¿ªÁËÁ½¸ö´°¿Ú£¬±ÈÈçDÅ̵ÄaaaÎļþ¼ÐºÍEÅ̵ÄbbbÎļþ¼ÐϵÄcccÎļþ¼Ð¶¼´ò¿ªµÄ»°£¬µã»÷command1,text1¾ÍÏÔʾ£º
D:\aaa
E:\bbb\ccc
Çë´ó¼Ò°ïæÏ£¬Ð»Ð»£¡
Private Const GW_HWNDNEXT = 2
Private Const GW_HWNDFIRST = 0
Private Const WM_GETTEXT = &HD
Private Declare Function GetNextWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As Long, ByVal wFlag As Long) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Function GetWindowList() As String
Dim hwnd As Long
Dim s As String
hwnd = Me.hwnd
hwnd = GetWindow(hwnd, GW_HWNDFIRST)
While hwnd <> 0
s = String(256, Chr(0))
GetClassName hwnd, s, 255
s = Replace(s, Chr(0), "")
If s = "CabinetWClass" Then
GetWindowList = GetWindowList & GetUrl(hwnd) & vbCrLf
End If
hwnd = GetNextWindow(hwnd, GW_HWNDNEXT)
Wend
End Function
Private Function GetUrl(hwnd As Long) As String
Dim NexthWnd As Long
Dim s As String
NexthWnd = 0
NexthWnd = FindWindowEx(hwnd, NexthWnd, vbNullString, vbNullString)
While NexthWnd <> 0
s = String(256, Chr(0))
GetClassName NexthWnd, s, 255
s = Replace(s, Chr(0), "")
If s = "Edit" Then
Ïà¹ØÎĵµ£º
Option Explicit
Dim FSO As New FileSystemObject
Dim currentFolder As Folder
Dim currentFolderName As String
Dim folderItem, fileItem
Private Sub Form_Load()
currentFolderName = FSO.GetFolder(App.Path) & "\content"
SeachFolder (FSO.GetFolder(currentFolderName))
End Sub ......
·ÖÀࣺVBѧϰ ×ֺţº ´ó´ó ÖÐÖРСС mid(×Ö·û´®£¬´ÓµÚ¼¸¸ö¿ªÊ¼£¬³¤¶È) ÔÚ[×Ö·û´®]ÖÐ[´ÓµÚ¼¸¸ö¿ªÊ¼]È¡³ö[³¤¶È¸ö×Ö·û´®]
ÀýÈç mid("СÐÀÎÞµÐ",1,3) Ôò·µ»Ø "СÐÀÎÞ"
instr(´ÓµÚ¼¸¸ö¿ªÊ¼,×Ö·û´®1,×Ö·û´®2) ´Ó¹æ¶¨µÄλÖÿªÊ¼²éÕÒ£¬·µ»Ø×Ö·û´®2ÔÚ×Ö·û´®1Öе ......
Õä¹óvbº¯ÊýÁбí
Variant ±äÁ¿µÄÄÚ²¿±íʾ:
_______________________________________________________________
·ûºÅ³£Á¿ Öµ ÄÚ²¿±íʾ ×Ö½ÚÊý
V_EMPTY 0 Empty
V_NULL 1 Null
V_INTEGER 2 Interger 2
V_LONG 3 Long 4
V_SINGLE 4 Single 4
V_DOUBLE 5 Double 8
V_CURRENCY 6 Currency 8
V_DATE 7 Date 8
V_STRI ......
ÎÞÒâÖз¢ÏÖVB ForÑ»·µÄÒ»¸öÌص㣺ÔÚÑ»·ÌåÖУ¬Æóͼ¸Ä±äÑ»·ÖÕÖ¹±äÁ¿Ê¹Ö®ÌáÇ°Í˳öÑ»·ÊÇͽÀ͵ġ£
Private Sub Form_Load()
Dim s(0 To 4) As String
Dim N As Integer, i As Integer
s(0) = "²âÊÔ1"
s(1) = "²âÊÔ2"
s(2) = "²âÊÔ3"
s(3) = "²âÊÔ4"
s(4) = "²âÊÔ5 ......