How can I execute PHP code from ASP.NET MVC

淺唱寂寞╮ 提交于 2019-12-25 16:56:20

问题


I want to do something like the following:

public class HomeController : Controller
{
    // Redirect to the phpinfo.php file
    public ActionResult PhpInfo()
    {
        return RedirectToRoutePermanent("~/Views/Home/PhpInfo.php");
    }
}

This errors out saying that the route cannot be found.

Any ideas?

Thanks, Zain


回答1:


Answer from scartag in the comments. Stating it below for posterity:

It doesn't seem to be possible using the C# part of ASP.NET, but you can post links by using <a href="/PhpInfo.php">PHP Info</a> syntax



来源:https://stackoverflow.com/questions/19917624/how-can-i-execute-php-code-from-asp-net-mvc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!