简体   繁体   English

将ASP.NET(C#)集成到PHP

[英]Integrate ASP.NET (C#) into PHP

是否可以通过php调用C#方法和asp.net页面?

Within a PHP generated page you can definitely link to a ASP.NET page. 在PHP生成的页面中,您可以绝对链接到ASP.NET页面。

If you want to call a C# method within a PHP script, I would suggest you using a RESTful API or SOAP to invoke C#'s method remotely. 如果要在PHP脚本中调用C#方法,建议您使用RESTful APISOAP远程调用C#方法。 Your ASP.NET application server will host the WebService, and your PHP script will be the client. 您的ASP.NET应用程序服务器将承载WebService,而您的PHP脚本将成为客户端。

I'm not exactly sure what your scenario is, but you may check out Phalanger . 我不确定您的情况如何,但是您可以查看Phalanger

Phalanger is an open-source compiler of PHP to .NET which also adds some extensions to PHP that make it possible to call .NET methods (and similarly, you can call compiled PHP from C#). Phalanger是PHP到.NET的开源编译器,它还为PHP添加了一些扩展名,从而可以调用.NET方法(同样,您可以从C#调用已编译的PHP)。

I'm not sure exactly what you mean, however it is possible to call page methods which have to be called via POST with content-type = "application/json; charset=utf-8". 我不确定您的意思是什么,但是可以通过content-type =“ application / json; charset = utf-8”来调用必须通过POST调用的页面方法 There are jQuery tactics to do this from a web page. jQuery策略可从网页执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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