{"id":472,"date":"2009-06-02T17:32:56","date_gmt":"2009-06-02T09:32:56","guid":{"rendered":""},"modified":"2014-03-11T22:15:09","modified_gmt":"2014-03-11T14:15:09","slug":"asp%e5%b0%81%e8%a3%85dll%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e4%b8%8d%e9%9c%80%e6%b3%a8%e5%86%8c%e7%bb%84%e4%bb%b6%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2009\/06\/02\/472.htm","title":{"rendered":"ASP\u5c01\u88c5DLL\u670d\u52a1\u5668\u4e0a\u4e0d\u9700\u6ce8\u518c\u7ec4\u4ef6\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u5728\u9700\u8981\u8c03\u7528DLL\u4fe1\u606f\u7684ASP\u9875\u9762\u9876\u90e8\u52a0\u4e0a\u4ee5\u4e0b\u4e24\u53e5\u5c31OK\u5566<br \/>\n\u8fd9\u6837\u65b9\u4fbf\u4e00\u4e9b\u670b\u53cb\u4f7f\u7528\u7684\u662f\u865a\u62df\u4e3b\u673a,\u4e5f\u6ca1\u6709\u6ce8\u518c\u7ec4\u4ef6\u7684\u6743\u9650\uff0c\u5c0f\u6280\u5de7\uff0c\u521a\u53d1\u73b0\uff0c\u5b66\u4e60\u5b66\u4e60\uff01<\/p>\n<p>\n&nbsp;\u7a0b\u5e8f\u4ee3\u7801<\/p>\n<p>&lt;% @ language=&quot;vbscript&quot; %&gt;<br \/>\n&lt;!&#8211;METADATA TYPE=&quot;typelib&quot; FILE=&quot;dll\u6587\u7ae0\u7684\u7edd\u5bf9\u8def\u5f84&quot;&#8211;&gt;<\/p>\n<p>\n\u4f8b\uff1a\u5728dll\u4e2d\u7f16\u8bd1\u4ee5\u4e0b\u4ee3\u7801\uff1a<br \/>\n&nbsp;\u7a0b\u5e8f\u4ee3\u7801<br \/>\nOption Explicit<br \/>\nPrivate Context As ScriptingContext<br \/>\nPrivate Application As Application<br \/>\nPrivate Response As Response<br \/>\nPrivate Request As Request<br \/>\nPrivate Session As Session<br \/>\nPrivate Server As Server<\/p>\n<p>Public Sub OnStartPage(PassedscriptContext As ScriptingContext)<br \/>\nSet Context = PassedscriptContext<br \/>\nSet Application = Context.Application<br \/>\nSet Request = Context.Request<br \/>\nSet Response = Context.Response<br \/>\nSet Server = Context.Server<br \/>\nSet Session = Context.Session<\/p>\n<p>End Sub<br \/>\nPublic Sub showinfo()<br \/>\nResponse.Write &quot;asp\u7f16\u8bd1DLL\uff0c\u4e0d\u9700\u8981\u670d\u52a1\u5668\u4e0a\u6ce8\u518c\u7ec4\u4ef6\uff01&quot;<\/p>\n<p>End Sub<\/p>\n<p>&#8216; \u91ca\u653e\u5185\u90e8\u5bf9\u8c61<br \/>\nPublic Sub OnEndPage()<br \/>\nSet Application = Nothing<br \/>\nSet Request = Nothing<br \/>\nSet Response = Nothing<br \/>\nSet Server = Nothing<br \/>\nSet Session = Nothing<br \/>\nSet Context = Nothing<br \/>\nEnd Sub<\/p>\n<p>\n\u5728\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5982\u6211\u7684dll\u653e\u5728\u4e86\u3000d:\\myweb\\test.dll<br \/>\n\u90a3\u4e48\u9700\u8981\u670d\u52a1\u5668\u6ce8\u518c\uff1aregsvr32 d:\\myweb\\test.dll<br \/>\n\u5728ASP\u4e2d\u4f7f\u7528\u65f6\uff1a<br \/>\n&nbsp;\u7a0b\u5e8f\u4ee3\u7801<br \/>\n&lt;%<br \/>\nDim newtest<br \/>\nSet newtest=Server.CreateObject(&quot;\u7c7b\u6a21\u5757\u540d\u79f0&quot;)<br \/>\nnewtest.showinfo()<br \/>\n%&gt;<\/p>\n<p>\n\u5728\u4e0d\u6ce8\u518c\u7ec4\u4ef6\u7684\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u8fd9\u6837\u6765\u4f7f\u7528\uff1a<br \/>\n&nbsp;\u7a0b\u5e8f\u4ee3\u7801<\/p>\n<p>&lt;% @ language=&quot;vbscript&quot; %&gt;<br \/>\n&lt;!&#8211;METADATA TYPE=&quot;typelib&quot; FILE=&quot;d:\\myweb\\test.dll&quot;&#8211;&gt;<\/p>\n<p>&lt;%<br \/>\nDim newtest<br \/>\nSet newtest=Server.CreateObject(&quot;\u7c7b\u6a21\u5757\u540d\u79f0&quot;)<br \/>\nnewtest.showinfo()<br \/>\n%&gt;<\/p>\n<p>\u5c31\u53ef\u4ee5\u8fbe\u5230\u4f60\u6240\u9884\u60f3\u7684\u6548\u679c\uff01<br \/>\n\u4e3a\u4e86\u4fdd\u62a4\u4f60\u7684\u7a0b\u5e8f\u4ee3\u7801\u5b89\u5168\uff0c\u7f16\u8bd1DLL\u662f\u4e2a\u4e0d\u9519\u7684\u9009\u62e9\uff01<\/p>\n<p>\u4e0d\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u5728\u672c\u673a\u6d4b\u8bd5\u901a\u8fc7\uff0c\u56e0\u4e3a\u5728\u7f16\u8bd1DLL\u6587\u4ef6\u751f\u6210\u65f6\uff0c\u5c31\u5df2\u81ea\u52a8\u6ce8\u518c\u4e86DLL\u6587\u4ef6<br \/>\n\u628a\u6587\u4ef6\u79fb\u5230\u670d\u52a1\u5668\u4e0a\u6216\u5176\u5b83\u7535\u8111\u4e0a\u6d4b\u8bd5\uff0c\u5747\u4e0d\u80fd\u6b63\u5e38\u8fd0\u884c\uff5e<br \/>\n\u770b\u6765asp\u60f3\u4f7f\u7528dll\u5c01\u88c5\u6280\u672f\uff0c\u8fd8\u662f\u5f97\u6ce8\u518c\u7ec4\u4ef6\uff0c\u79fb\u52a8\u6027\u4f4e<br \/>\n\u8fd8\u662f.net\u6709\u524d\u9014\u5440\uff01\uff5e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u9700\u8981\u8c03\u7528DLL\u4fe1\u606f\u7684ASP\u9875\u9762\u9876\u90e8\u52a0\u4e0a\u4ee5\u4e0b\u4e24\u53e5\u5c31OK\u5566 \u8fd9\u6837\u65b9\u4fbf\u4e00\u4e9b\u670b\u53cb\u4f7f\u7528\u7684\u662f\u865a\u62df\u4e3b\u673a,\u4e5f\u6ca1\u6709\u6ce8\u518c\u7ec4\u4ef6\u7684\u6743\u9650\uff0c\u5c0f\u6280\u5de7\uff0c\u521a\u53d1\u73b0\uff0c\u5b66\u4e60\u5b66\u4e60\uff01 &nbsp;\u7a0b\u5e8f\u4ee3\u7801 &lt;% @ language=&quot;vbscript&quot; &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-472","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":66334,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/472\/revisions\/66334"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=472"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}