System.Diagnostics.Process.Start不Default.aspx.cs工作 [英] System.Diagnostics.Process.Start doesn't work in Default.aspx.cs
问题描述
我++在C一些地方建立了一个项目,有的在asp.net/c#。
I have a project built with some parts in c++, some in asp.net/c#.
有一个 CHtmlView的
建在C ++中调用一个aspx页面( Navigate2(.. Default.aspx的,NULL,NULL);
)
There is a CHtmlView
built in c++ that call an aspx page (Navigate2(..Default.aspx,NULL,NULL);
)
在 Default.aspx.cs
我调用外部程序例如
System.Diagnostics.Process.Start("http://stackoverflow.com/");
在我使用Windows Server 2003计算机,它工作正常。在其他的PC,与Windows 8和IIS 8没有任何反应。
In my PC with windows server 2003, it works fine. In an other PC, with windows 8 and IIS 8 nothing happens.
什么是错的?你有一些建议给我吗?
What is wrong? Do you have some suggestions for me?
推荐答案
如果你在一个网页服务器上调用的Process.Start
,它将执行服务器上的,而不是客户端上。由于IIS进程不是用户互动的过程,你不会看到在所有的东西。
If you call Process.Start
in a page on your server, it will execute on the the server, not on the client. Since the IIS process isn't a User Interactive process, you won't see anything at all.
这将在开发机器上,因为IISEx preSS可能会工作的是的用户互动的过程。
It will probably work on your development machine since IISExpress is a User Interactive process.
有没有太多的信息去与在您的文章,你想达到什么,但你可能会寻找的 的Response.Redirect
。
There is not much information to go with in your post what you want to achieve, but you might be looking for Response.Redirect
.
这篇关于System.Diagnostics.Process.Start不Default.aspx.cs工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!