且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows Phone 7:如何打开网络浏览器?

更新时间:2023-11-27 21:47:40

Windows Phone 论坛 > Windows Phone 7 > 打开网络浏览器

如果你想打开内置的IE浏览器,那么你需要使用WebBrowserTask 对象.

If you want to open the built-in IE Browser then you need to use WebBrowserTask object.

为此添加对 Microsoft.Phone 和Microsoft.Phone.Tasks.然后,您可以使用以下代码:

To do this add references to Microsoft.Phone and Microsoft.Phone.Tasks. You can then launch the IE Browser using the following code:

WebBrowserTask wbt = new WebBrowserTask(); 
wbt.URL = "http://www.google.com";  
wbt.Show();

如果您想在应用程序中嵌入浏览器窗口,请使用浏览器控件.将 WebBrowser 控件的实例添加到您的表单然后您可以使用您提供的名称在代码中引用它它.(默认名称为webBrowser1")

If you want to embed a browser window inside your application then use the WebBrowser control. Add an instance of the WebBrowser control to your form then you can reference it in code using the name you give it. (Default name is "webBrowser1")