如何从ASP.NET MVC执行PHP代码 [英] How can I execute PHP code from ASP.NET MVC

查看:74
本文介绍了如何从ASP.NET MVC执行PHP代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做以下事情:

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.

有什么想法吗?

谢谢, Zain

推荐答案

在评论中添加Scartag.下面为后代说明:

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

似乎无法使用ASP.NET的C#部分,但是您可以使用<a href="/PhpInfo.php">PHP Info</a>语法发布链接

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

这篇关于如何从ASP.NET MVC执行PHP代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆