WPF WebBrowser控件无法正确呈现App.net

时间:2012-10-18 16:28:59

标签: c# css wpf browser rendering

我刚刚完成了一个库来访问App.net https://github.com/appdotnet/api-spec的所有方法,并且已经开始将其添加到我的客户端。

但是为了授权用户,我需要打开指向http://www.app.net/子页面的WebBrowser。但app.net域中的每个url在我使用的WebBrowser控件中都是错误的(我认为它主要是关于缺少CSS而且可能是一些JavaScript),所以我无法继续。

任何人都知道我可以改变什么(已经使用FullTrust玩过)?在Internet Explorer中打开相同的页面可以正常工作。

这是我的简单测试窗口的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Security.Permissions;

namespace NymphAppNetTester
{
    /// <summary>
    /// Interaction logic for BrowserTest.xaml
    /// </summary>
    /// 

    [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]

    public partial class BrowserTest : Window
    {

        [PermissionSet(SecurityAction.Demand, Name = "FullTrust")]
        public BrowserTest()
        {
            InitializeComponent();

            buttonGo_Click_1(null, null);
        }

        private void buttonGo_Click_1(object sender, RoutedEventArgs e)
        {
            webbrowserTest.Navigate(textboxUrl.Text);
        }
    }
}

和XAML

<Window x:Class="NymphAppNetTester.BrowserTest"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="BrowserTest" Height="478.723" Width="565.35">
    <Grid>
        <TextBox x:Name="textboxUrl" Height="23" Margin="10,10,58.2,0" TextWrapping="Wrap" VerticalAlignment="Top" Text="http://www.app.net/"/>
        <WebBrowser x:Name="webbrowserTest" Margin="10,38,10.2,10.4"/>
        <Button x:Name="buttonGo" Content="Go" HorizontalAlignment="Right" Margin="0,11,10.2,0" VerticalAlignment="Top" Width="43" Click="buttonGo_Click_1"/>

    </Grid>
</Window>

0 个答案:

没有答案
相关问题