VBÎļþ·ÛËé»ú
'´úÂë:
Option Explicit
'======================ÓÃÓÚ²éÕÒ½ø³ÌºÍÖÕÖ¹½ø³ÌµÄAPIº¯Êý³£Êý¶¨Òå================ =====
Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function ProcessFirst Lib "kernel32" Alias "Process32First" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function ProcessNext Lib "kernel32" Alias "Process32Next" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Const MAX_PATH As Integer = 260
Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szExeFile As String * MAX_PATH
End Type
Const TH32CS_SNAPheaplist = &H1
Const TH32CS_SNAPPROCESS = &H2
Const TH32CS_SNAPthread = &H4
Const TH32CS_SNAPmodule = &H8
Const TH32CS_SNAPall = TH32CS_SNAPPROCESS + TH32CS_SNAPheaplist + TH32CS_SNAPthread + TH32CS_SNAPmodule
'======================ÔÚWIN2000ÏÂÌáÉý±¾½ø³ÌȨÏÞµÄAPIº¯Êý³£Êý¶¨Òå=========== ==========
Const STANDARD_RIGHTS_REQUIRED = &HF0000
Const TOKEN_ASSIGN_PRIMARY = &H1
Const TOKEN_DUPLICATE = (&H2)
Const TOKEN_IMPERSONATE = (&H4)
Const TOKEN_QUERY = (&H8)
Const TOKEN_QUERY_SOURCE = (&H10)
Const TOKEN_ADJUST_PRIVILEGES = (&H20)
Const TOKEN_ADJUST_GROUPS = (&H40)
Const TOKEN_ADJUST_DEFAULT = (&H80)
Const TOKEN_ALL_ACCESS = (STANDARD_RIG
Ïà¹ØÎĵµ£º
VB ×Ö·û´®´¦Àíº¯Êý¼¯
ÊÕ²Ø
mid(×Ö·û´®£¬´ÓµÚ¼¸¸ö¿ªÊ¼£¬³¤¶È)
ÔÚ[×Ö·û´®]ÖÐ[´ÓµÚ¼¸¸ö¿ªÊ¼]È¡³ö[³¤¶È¸ö×Ö·û´®]
ÀýÈç mid("СÐÀÎÞµÐ",1,3) Ôò·µ»Ø "СÐÀÎÞ"
instr(´ÓµÚ¼¸¸ö¿ªÊ¼,×Ö·û´®1,×Ö·û´®2)
´Ó¹æ¶¨µÄλÖÿªÊ¼²éÕÒ ......
¹¤×÷ÐèÒª£¬Õë¶ÔjavaÎļþ£¬×÷ÁËÒ»¸öÐÐÊýͳ¼ÆµÄ¹¤¾ß¡£Í³¼ÆµÄÖ÷Òª´úÂëÈçÏ£º
Set srcIn = fso.OpenTextFile(fileNm, ForReading)
Do While Not srcIn.AtEndOfStream
buf = srcIn.ReadLine
&nbs ......
ÌâÄ¿:
ÈçºÎ»ñÈ¡ÍøÒ³ÏÂÎÄ×ÖµÄÁ´½ÓµØÖ·
´°¿ÚÓÐWebBrowser1£¬ºÍÒ»¸öText1
ÏÖÔÚ
Private Sub Form_Load()
WebBrowser1.Navigate "http://www.baidu.com"
End Sub
´ò¿ª´°ÌåÏÔʾ°Ù¶ÈµÄÊ×Ò³£¬ÒªÇ󻬶¯Êó±êµ½“ÐÂÎŔʱ
Text1ÀïÏÔʾhttp://news.baidu.com/
»¬¶¯µ½“Ìû°É”ʱ
Text1ÀïÏÔʾÇå¿ ......
http://blog.donews.com/sloo/archive/2006/01/29/711269.aspx
1.ÓÃMicrosoft Internet Transfer Control ¿Ø¼þ£¨ÔÚ²¿¼þÖÐÌí¼Ó£©£¬´úÂë·Ç³£¼òµ¥£¬ÈçÏ£¨ÔÚformÉÏÌí¼ÓÒ»¸öInet1ºÍText1ºÍCommand1£©£º
Private Sub Command1_Click()
Text1.Text = Inet1.OpenURL("http://www.vbgood.com/")
End Sub
2.Èç¹ûÊÇʹÓà W ......
ÈçºÎÈûõÆƬÔÚvbµÄ¿ò¼ÜÀï²¥·Å
'Microsoft PowerPoint 9.0(Office 2000µÄ£¬Èç¹ûÊÇ97ÔòÊÇ8.0) Object Library)
''Microsoft PowerPoint 11.0(Office 2003) Object Library)
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 'ÑÓʱAPIÉùÃ÷
Private Sub Form_Load()
Dim ppt As New PowerPoint. ......