简体   繁体   English

如何将请求直接发送到.DLL(不是.ASPX,.ASHX等)?

[英]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.

相关问题 如何覆盖 Upload.aspx 或 AllItems.aspx 等 SharePoint 2013(不是 SP 设计器) - How can you override Upload.aspx or AllItems.aspx etc. SharePoint 2013 (NOT SP Designer) 如何使Ajax Post安全到Handler.ashx并阻止直接调用该处理程序 - How do you make a Ajax Post to a Handler.ashx safe and stop the handler being called directly 您如何直接调用从DLL导出的本机函数? - How do you directly call a native function exported from a DLL? 如何将 Excel 工作表复制到新工作簿中并带上所有图表、图像等? - How do you copy an Excel worksheet into a new workbook AND bring all the charts, images, etc.? 如何从ashx或webservice呈现用户控件? - How do you render a User control from a ashx or webservice? 如何访问在ashx中修改过的aspx中的会话? - How to access session in aspx that was modified in ashx? 使用LINQ,如何为与模式“ q1,q2”等匹配的值过滤字符串列表? - Using LINQ how do you filter a list of strings for values that match the pattern “q1, q2” etc.? 如何本地化ReportViewer标签,列标题等? - How do I localize ReportViewer labels, column headers, etc.? 如何使用.ashx处理程序发送控件 - How to send controls with .ashx Handlers 如何在aspx中创建图表 - How do you create a chart in aspx
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM