简体   繁体   中英

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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM