2015-10-06 109 views
-2

我试图运行我的网页,Console.WriteLine没有工作。为什么我的System.Diagnostics.Process.Start不能工作?

有谁知道为什么?

private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) 
     { 
       System.Diagnostics.Process.Start("https://www.google.com.sg/"); 
       Console.WriteLine("Running"); 
       System.Diagnostics.Trace.WriteLine("run"); 

     } 
+2

你究竟想要达到什么目的? – rbm

+0

对我来说,它看起来很像你有一个WinForms应用程序,而不是控制台应用程序。 –

+0

我正在创建一个使用VS2013的窗体,我想用窗体打开我的jsp页面。我正在做眼动追踪项目,这也需要使用mysql和ogama – Zynnette

回答

0

你应该使用如下代码

this.webBrowser1.Navigate("http://google.com"); 

而且它的怪异导航到另一个DocumentCompleted事件。以按钮点击处理程序为例来实现它。