Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʹÓÃVB½«ASP´úÂë·â×°µ½DLLÎļþÍêÕûʵÀý

ʹÓÃVB½«ASP´úÂë·â×°µ½DLLÎļþÍêÕûʵÀý
http://blog.csdn.net/cncco/archive/2007/10/20/1834865.aspx
ÓÃVB·â×°ASP£¬½¨Á¢SayHello²âÊÔ³ÌÐò
1¡¢´ò¿ªVB6£¬Ð½¨ActiveX DLL
2¡¢ÔÚ¹¤³ÌÒýÓÃÖмÓÈëMicrosoft Active Server Pages Object LibraryÑ¡Ôñ
3¡¢Ìî¼Ó´úÂëÈçÏ£º
'Code Start
'ÉùÃ÷²¿·Ö
Private MyScriptingContext As ScriptingContext
Private MyApplication As Application
Private MyRequest As Request
Private MyResponse As Response
Private MyServer As Server
Private MySession As Session
'ÏÂÃæ¶¨Ò幫Óú¯Êý£¨ÔÚVBÖзÃÎÊASP¶ÔÏ󣬼´ÔÚVBÖпÉÒÔÓÃMyApplicationµÈͬÓÚASPÖеÄApplication¡¢MyRequestµÈͬÓÚASPÖеÄRequest¡¢ MyResponseµÈͬÓÚASPÖеÄResponse¡¢ MyServerµÈͬÓÚASPÖеÄServer¡¢ MySessionµÈͬÓÚASPÖеÄSession ʹÓã©
Public Sub OnStartPage(PassedScriptingContext As ScriptingContext)
Set MyScriptingContext = PassedScriptingContext
Set MyApplication = MyScriptingContext.Application
Set MyRequest = MyScriptingContext.Request
Set MyResponse = MyScriptingContext.Response
Set MyServer = MyScriptingContext.Server
Set MySession = MyScriptingContext.Session
End Sub
Public Sub OnEndPage()
Set MyScriptingContext = Nothing
Set MyApplication = Nothing
Set MyRequest = Nothing
Set MyResponse = Nothing
Set MyServer = Nothing
Set MySession = Nothing
End Sub
'½¨Á¢×Ô¶¨Ò庯ÊýSayHello
Public Sub SayHello()
MyResponse.Write ("Hello World")
End Sub
'Code End
4¡¢½«ÀàÃû¸ÄΪ£ºHelloWorld   ½«¹¤³ÌÃû¸ÄΪ£ºTestVBCode
5¡¢Éú³ÉTestVBCode.DLLÎļþ£¬²¢Ê¹ÓÃWindowsÔËÐÐ×¢²á×é¼þÃüÁîRegsvr32 ·¾¶\TestVBCode.DLL×¢²áºó¼´¿ÉʹÓᣣ¨Ð¶ÔØ×é¼þÃüÁîΪRegsvr32 /u ·¾¶\TestVBCode.DLL£©
6¡¢½¨Á¢Test.aspÎļþ£¬´úÂëÈçÏÂ
<%
'VB×Ô½¨º¯Êýµ÷Óøñʽ
'Set ¶ÔÏóÃû=Server.CreateObject("¹¤³ÌÃû.ÀàÃû")
'¶ÔÏóÃû.×Ô½¨º¯ÊýÃû
Set MyTestObj = Server.CreateObject("TestVBCode.HelloWorld")
MyTestObj .SayHello
%>
7¡¢ÔËÐÐTest.aspÎļþ½á¹ûÏÔʾÈçÏ£º
Hello World
=================
ÒÔÉÏ´úÂëÔÚVB6,Win2003ϲâÊÔͨ¹ý.
 
˵Ã÷:
ÉùÃ÷²¿·Ö:ÎÒÃÇÔÚµ÷ÓÃ×Ô¼ºµÄaplactionʱ,ÏÈÒªÉùÃ÷
OnStartPage²¿·Ö:µ±ASPÖ´ÐÐʱ¾ÍÊÇÔÚ·þÎñÆ÷ÉÏ´´½¨ÕâÐ


Ïà¹ØÎĵµ£º

VBʵÀý —ÍòÄêÀú £¨1£©

1¡¢´´½¨¿Ø¼þ£ºlbl1¡¢txt1¡¢lbl2¡¢cmd1
2¡¢lbl1.caption=ÊäÈëÈÕÆÚ£¨ÈÎÒ»ÖÖÕýÈ·¸ñʽ£©£º
ÉèÖÃlbl1¡¢txt1¡¢lbl2¡¢cmd1µÄ×ÖÌå´óС¼°ÑÕÉ«£»
3¡¢Ë«»÷°´Å¥“È·ÈÏ”£¬Ìí¼Ó´úÂ룬Ч¹ûΪ£º
    Option Explicit
        Private Sub cmd1_Click()
  &nb ......

VBÄÚ²¿¿Ø¼þ

    ÊÔ×ÅÓÃÁËÒ»ÏÂMindManager,ʹÓúÜÈÝÒ×,ÏÂÃæÊÇÎÒÁ·Ï°×Å×öµÄÒ»¸öͼÐÎ,Ï£ÍûÒÔºó»áÔ½ÓÃÔ½ÊìÁ·,×öµÃ¸üºÃ!
                               & ......

VB.NETÖвÙ×÷xmlÎļþ£¨²åÈë½Úµã¡¢Ð޸ġ¢É¾³ý£©

ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
<price>5.95</price>
</book>
< ......

VBÇå³ýCookies


Option Explicit
Private Const ERROR_CACHE_FIND_FAIL As Long = 0
Private Const ERROR_CACHE_FIND_SUCCESS As Long = 1
Private Const ERROR_FILE_NOT_FOUND As Long = 2
Private Const ERROR_ACCESS_DENIED As Long = 5
Private Const ERROR_INSUFFICIENT_BUFFER As Long = 122
Private Const MAX_PATH As Long ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ