[英]How do you send a request directly to .DLL (not .ASPX, .ASHX, etc.)?
I want to know how can we send direct request to .DLL with some parameters. 我想知道如何使用某些参数将直接请求发送到.DLL。 I really don't want to use .ASPX and .ASHX.
我真的不想使用.ASPX和.ASHX。 I hope this .DLL request is used for more secure site.
我希望此.DLL请求可用于更安全的网站。
For example: IRCTC (India Railway site): 例如:IRCTC(印度铁路站点):
https://www.irctc.co.in/cgi-bin/bv60.dll/irctc/services/login.do
Please let me know how we can send or execute page from .DLL in ASP.NET. 请让我知道我们如何从ASP.NET中的.DLL发送或执行页面。
You can do this by implementing the IHttpHandler
interface and pretty much build your own routing from there (check the url and figure out what you should do and write the result using context.Response
). 您可以通过实现
IHttpHandler
接口并在此基础上构建自己的路由来做到这一点(检查url并确定应该做什么,并使用context.Response
写入结果)。 Then register that in the web.config like this for IIS6 or lower: 然后将其注册到IIS6或更低版本的web.config中,如下所示:
<httpHandlers>
<add path="*" verb="*" type="YOUR.TYPE, YOUR.ASSEMBLY"/>
</httpHandlers>
Or like this for IIS7 or higher: 或对于IIS7或更高版本来说是这样的:
<system.webServer>
<handlers>
<add name="All" path="*" verb="*" type="YOUR.TYPE, YOUR.ASSEMBLY"/>
</handlers>
</system.webServer>
However, this should not be any more secure then using the framework. 但是,这不应该比使用该框架更安全。 What is your concern?
你有什么事
I'm afraid, there is no way to do that except remoting. 恐怕,除了远程处理,别无选择。 But it is not a good idea, just use .asmx for that.
但这不是一个好主意,只需使用.asmx即可 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.