简体   繁体   English

System.Diagnostics.Process.Start在Default.aspx.cs中不起作用

[英]System.Diagnostics.Process.Start doesn't work in Default.aspx.cs

I have a project built with some parts in c++, some in asp.net/c#. 我有一个用c ++编写的项目,一些在asp.net/c#中编写的项目。

There is a CHtmlView built in c++ that call an aspx page ( Navigate2(..Default.aspx,NULL,NULL); ) 有一个用C ++内置的CHtmlView调用aspx页面( Navigate2(..Default.aspx,NULL,NULL);

in Default.aspx.cs I call an external process eg Default.aspx.cs我称外部进程为

System.Diagnostics.Process.Start("http://stackoverflow.com/");   

In my PC with windows server 2003, it works fine. 在装有Windows Server 2003的PC上,它可以正常工作。 In an other PC, with windows 8 and IIS 8 nothing happens. 在使用Windows 8和IIS 8的另一台PC中,什么也没有发生。

What is wrong? 怎么了? Do you have some suggestions for me? 您对我有什么建议吗?

If you call Process.Start in a page on your server, it will execute on the the server, not on the client. 如果在服务器上的页面中调用Process.Start ,它将在服务器上执行,而不是在客户端上执行。 Since the IIS process isn't a User Interactive process, you won't see anything at all. 由于IIS进程不是“用户交互”进程,因此根本看不到任何东西。

It will probably work on your development machine since IISExpress is a User Interactive process. 由于IISExpress 一个用户交互过程,因此它可能会在您的开发计算机上运行。

There is not much information to go with in your post what you want to achieve, but you might be looking for Response.Redirect . 帖子中没有多少信息要实现,但是您可能正在寻找Response.Redirect

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

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