¹ØÓÚActiveXµÄ½Ì³Ì[vb]£¨×ªÌû£©
¹ØÓÚActiveXµÄ½Ì³Ì
Visual BasicÊÇÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼ÆÓïÑÔ£¬Î¢Èí¹«Ë¾ÍƳöÁËActiveX¼¼Êõ£¬ÀûÓÃActiveX¼¼ÊõÌá³öµÄ±ê×¼£¬¶Ô½çÃæµÄÉè¼Æ½øÐÐÁË·â×°£¬ÐγÉÁËһϵÁбà³Ì¿Ø¼þ£¬¼´Ìض¨¹¦ÄܵijÌÐòÄ£¿é¡£ÔÚ³ÌÐòµÄÉè¼ÆÖУ¬Éè¼ÆÈËÔ±Ö»ÐèÒªÍ϶¯ËùÐè¿Ø¼þµ½´°Ì壬Ȼºó¶Ô¿Ø¼þ½øÐÐÊôÐÔÉèÖúÍʹÓÃÆä·½·¨¡¢Ê¼þ¼´¿É£¬´ó´ó¼õÇáÁË·±ËöµÄ³ÌÐòÉè¼Æ¡£
µÚÒ»½Ú ÈÏʶ²¢×°ÔØActiveX¿Ø¼þ
ÈÎÎñ1£ºActiveX¿Ø¼þµÄ¸ÅÄîºÍActiveX¿Ø¼þµÄ×°ÔØ·½·¨
¡¾ÈÎÎñµÄÌá³ö¡¿Visual Basic¹¤¾ßÏäÉϵıê×¼¿Ø¼þÖ»ÓÐ21¸ö¡£¶ÔÓÚ¸´ÔÓµÄÓ¦ÓóÌÐò£¬½ö½öʹÓÃһЩ±ê×¼¿Ø¼þÊDz»¹»µÄ£¬¿ÉÒÔÓ¦ÓÃVisual BasicÒÔ¼°µÚÈý·½¿ª·¢ÉÌÌṩµÄ´óÁ¿AcitveX¿Ø¼þ¡£ÕâЩ¿Ø¼þ¿ÉÒÔÌí¼ÓÔÚ¹¤¾ßÏäÉÏ¡£Ä¿Ç°ÔÚInternetÉÏ´óÔ¼ÓÐ1000¶àÖÖAcitveX¿Ø¼þ¿É¹©ÏÂÔØ£¬´ó´ó½ÚÔ¼ÁËÎÒÃǵĿª·¢Ê±¼ä¡£
±¾ÈÎÎñÖ÷Òª°üÀ¨ÒÔÏÂÄÚÈÝ£º
(1) ¿Ø¼þ·ÖÀ༰ActiveXµÄ¸ÅÄî¡£
(2) ×°ÔØActiveX¿Ø¼þ¡£
11.1.1 ¿Ø¼þ·ÖÀ༰ActiveXµÄ¸ÅÄî
Visual Basic 6.0ÖпؼþÖ÷Òª·ÖΪÈýÖÖ£ºÄÚ²¿¿Ø¼þ£¨±ê×¼¿Ø¼þ£©¡¢ActiveX¿Ø¼þ£¨Íⲿ¿Ø¼þ£©ºÍ¿É²åÈë¶ÔÏó¡£
1£®ÄÚ²¿¿Ø¼þ£¨Ò²³Æ±ê×¼¿Ø¼þ£©
¾ÍÊÇÎÒÃÇͨ³£Ê¹ÓõÄÈç±êÇ©¡¢Îı¾¿ò¡¢ÃüÁî°´Å¥µÈ³£Óÿؼþ£¬ÔÚÎÒÃÇÔËÐÐVisual Basic 6.0»·¾³Ê±£¬¿É×Ô¶¯ÔÚ¹¤¾ßÏäÖгöÏÖ¡£Èçͼ11-1Ëùʾ¡£
ͼ11-1 ¹¤¾ßÏäÖеÄÄÚ²¿¿Ø¼þ
2£®ActiveX¿Ø¼þ
£¨1£©ActiveX²¿¼þ
VB¹¦ÄÜÖ®ËùÒÔÇ¿´ó£¬ºÜ´ó³Ì¶ÈÉÏÊǽèÖúÓÚActiveX²¿¼þ¡£ËùνActiveX²¿¼þÊÇÖ¸Ò»¼þ¿ÉÕдýµÄ´úÂ룬ÈçÒ»¸ö.exe ¡¢.dll»ò .ocxÎļþ£¬ËüÃÇÔÚÌṩ¶ÔÏóʱ×ñÑActiveXµÄ¹æ·¶¡£ÔÚVBÖУ¬¾ßÓÐËÄÖÖÀàÐ͵ÄActiveX²¿¼þ£ºActiveX ¿Ø¼þ¡¢ActiveX.EXE¡¢ActiveX.DLL ¡¢ActiveX Îĵµ¡£ActiveX.EXE²¿¼þÊDz»¿ÉÊӵĴúÂ벿¼þ£¬Äܹ»·þÎñÓÚ¶à¸öÓ¦ÓóÌÐò£¬²¢ÇÒÄܹ»ÔÚÔ¶³Ì¼ÆËã»úÉÏÔËÐУ¬ÄÜ°²×°ÔÚ·þÎñÆ÷¶Ë£»ActiveX.DLL ²¿¼þÊDz»¿ÉÊӵĴúÂ벿¼þ£¬Äܹ»ÓëÓ¦ÓóÌÐòÔËÐÐÔÚͬһ¸ö½ø³ÌÖУ¬ÄÜ°²×°ÔÚ¿Í»§¶Ë£»ActiveX ¿Ø¼þÊÇÒ»¸ö¿ÉÊӵIJ¿¼þ£¬Äܹ»×÷Ϊ¿Ø¼þ±»ÍϷŵ½²»Í¬µÄÓ¦ÓóÌÐòÖУ»ActiveX ÎĵµÒ²ÊÇÒ»¸ö¿ÉÊӵIJ¿¼þ£¬Äܹ»Í¨¹ýInternetÉϵÄWebä¯ÀÀÆ÷´ò¿ª¡£
£¨2£©ActiveX¿Ø¼þ
ActiveX¿Ø¼þ³ÆΪÀ©³ä¿Ø¼þ¡£ActiveX¿Ø¼þÊÇÒ»ÖÖ¾ßÓпÉÊÓÉè¼ÆÍâ¹Û£¬²¢ÇÒÄܹ»×÷Ϊ¿É²å¼þÒýÈëµ½Ó¦ÓóÌÐòÖÐÈ¥µÄActiveX²¿¼þ£¬ÈçADO Data¿Ø¼þ¾ÍÊÇÆäÖÐÖ®Ò»¡£“ActiveX¿Ø¼þ”ÊÇÒ»ÖÖÀ©Õ¹ÃûΪ .OCXµÄ¶ÀÁ¢Îļþ£¬Í¨³£´æ·ÅÔÚWindowsµÄSystemĿ¼ÖС£
´ó²¿·ÖÓ¦ÓóÌÐò¿ÉÒÔÓÃÄÚ²¿¿Ø¼þÀ´Éè¼Æ£¬µ«ÊÇÓÐЩ¹¦ÄÜ£¬È磺¶àýÌå¡¢¶¯»¡¢¼ÆËã»úͨѶµÈÎÞ·¨ÓÃÄÚ²¿¿Ø¼þÀ
Ïà¹ØÎĵµ£º
ת×Ô£ºhttp://www.52arm.com/Article_Show.asp?ArticleID=186
×÷Õߣºweidian ---±¾Õ¾Ô´´ µã»÷Êý£º4721 ·¢±íʱ¼ä£º2008-5-7 ±à¼£ºsanzang
Winsock¿Ø¼þ½¨Á¢ÔÚTCP¡¢UDPÐÒéµÄ»ù´¡ÉÏ£¬Íê³ÉÓëÔ¶³Ì¼ÆËã»úµÄ ......
ÎÄÕÂÀ´Ô´:vb´óÊÀ½ç ×÷ÕߣºÍõ¹úÈÙ
¡¸VB ûÓÐÌṩÕâÑùµÄ¹¦ÄÜ£¬ ±ØÐëºô½Ð Windows API¡¹£¬ µ±±ÊÕßÕâÑù»Ø´ð¶ÁÕßÖ®áᣬÓÐЩ¶ÁÕß»áÒªÇó±ÊÕß½éÉÜ Windows API ·½ÃæµÄÊé¼®£¬ ÓÈÆäÊÇÖÐÎÄÊ飬 µ«Êµ¼ÊÉÏ£¬Ä¿Ç°ÊÐÃæÉÏÖ»¿´µ½Ò»±¾ÔÎÄÊé(ZD Press ³ö°æµÄ Visual Basic 5.0 Programming Guide to Win32 API)£¬ ÖÐÎÄÊéÔòδ¼û¹ý£¬ Ϊʲ÷áÃ»Ó ......
Option Explicit
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias ......
Private Declare Function InternetSetCookie Lib "wininet.dll" Alias "InternetSetCookieA" (ByVal lpszUrlName As String, ByVal lpszCookieName As String, ByVal lpszCookieData As String) As Boolean
Private Declare Function InternetGetCookie Lib "wininet.dll" Alias "InternetGetCookieA" (ByVal lpszUrlName ......