简体   繁体   English

我想在C#asp.net(mvc)中运行exe文件

[英]I want to run exe file in C# asp.net (mvc)

I want to run a .exe file in C# asp.net (mvc). 我想在C#asp.net(mvc)中运行.exe文件。 I was able to run that particular .exe file but it file needs the other files which were in my computer's directory. 我能够运行该特定的.exe文件,但它的文件需要我计算机目录中的其他文件。

How can I add that directory to my project? 如何将该目录添加到我的项目中? This is my running project. 这是我正在运行的项目。 The exe file can't find the files which the .exe files needs to execute. exe文件找不到.exe文件需要执行的文件。

The following is the code which I can run the .exe file from my PC. 以下是我可以从我的PC运行.exe文件的代码。

public string Onclick()
    {

        Process p = new Process();
        p.StartInfo.FileName = @"C:\Users\Talha\Desktop\New folder\linkedin\server";
        p.Start();
       // ProcessInfo.Start(@"C:\Users\Talha\Desktop\New folder\linkedin\server.exe");
        return "BUTTON ONCLICK";
    }

你应该写这个地址:

"C:\Users\Talha\Desktop\New%20folder\linkedin\server.exe"

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

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