Vb.net Windows Phone 8 Web浏览器控件不工作

Vb.net Windows Phone 8 Web浏览器控件不工作,vb.net,xaml,windows-phone-8,webbrowser-control,windows-phone,Vb.net,Xaml,Windows Phone 8,Webbrowser Control,Windows Phone,我试图导航到URL,但web浏览器控件显示空白页或显示找不到页面错误。这是我的密码: Private Sub qwb_Loaded(sender As Object, e As RoutedEventArgs) Handles qwb.Loaded NavigationContext.QueryString.TryGetValue("url", url) Dim urltonav = New Uri(url, UriKind.RelativeOrAbsolute) qwb

我试图导航到URL,但web浏览器控件显示空白页或显示找不到页面错误。这是我的密码:

Private Sub qwb_Loaded(sender As Object, e As RoutedEventArgs) Handles qwb.Loaded
    NavigationContext.QueryString.TryGetValue("url", url)
    Dim urltonav = New Uri(url, UriKind.RelativeOrAbsolute)
    qwb.Navigate(urltonav)
End Sub
附:网址是。在Page1_Loaded事件下加载页面也不起作用

这是具有web浏览器控件的页面的XAML代码:

<phone:PhoneApplicationPage
    x:Class="MyApp.Page1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

       <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

               <StackPanel Grid.Row="0" Margin="12,17,0,28"/>
        <phone:WebBrowser x:Name="qwb" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.RowSpan="2" Height="768" Width="480" IsScriptEnabled="True"/>

         </Grid>

</phone:PhoneApplicationPage>


我正在尝试在设备上运行应用程序,而不是在WiFi正常工作的模拟器上运行。操作系统版本是WindowsPhone8,我有VisualStudio2012。我认为网络没有问题。我甚至尝试使用.Source属性代替导航,但它也不起作用。

您可能想访问(没有www)

您能显示您的url吗

  • 若它是html页面,那个么你们应该把它放在你们解决方案的文件夹中,然后写下

    导航(新Uri(“ch51130.html”,UriKind.Relative))

  • 如果是像www.google.com这样的简单url,那么

    Uri=新Uri(“”)


该URL在桌面和WP8设备的IE上都失败(找不到404)。为什么您希望它在代码中工作?谢谢,这解决了问题。但我在web浏览器控件中遇到“我们在验证安全证书时遇到问题”错误。如何抑制/忽略或禁用它?