How do you send a request directly to .DLL (not .ASPX, .ASHX, etc.)?
I want to know how can we send dire开发者_JAVA技巧ct request to .DLL with some parameters. I really don't want to use .ASPX and .ASHX. I hope this .DLL request is used for more secure site.
For example: IRCTC (India Railway site):
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.
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
). Then register that in the web.config like this for IIS6 or lower:
<httpHandlers>
<add path="*" verb="*" type="YOUR.TYPE, YOUR.ASSEMBLY"/>
</httpHandlers>
Or like this for IIS7 or higher:
<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.
精彩评论