开发者

Can't get Fragment information from a System.Windows.Control.WebBrowser

开发者 https://www.devze.com 2023-01-14 17:54 出处:网络
I try to get the string after the sign # in my url of my WebBrowser with: MessageBox.Show(UI_WebBrowser.Source.Fragment);

I try to get the string after the sign # in my url of my WebBrowser with:

MessageBox.Show(UI_WebBrowser.Source.Fragment);

But it return me a null string! I also tried to navigate to a string like "http://www.google.com/#123" and nothing...

Need help please! :)

PS: my code:

    private void checkIfUpdate()
    {
        UI_WebBrowser.Navigated += new System.Windows.Navigation.NavigatedEventHandler(UI_WebBrowser_Navigated);
        UI_WebBrowser.Navigate("http://www.google.com/#123");
    }

    void UI_WebBrowser_Navigated(object sen开发者_运维知识库der, System.Windows.Navigation.NavigationEventArgs e)
    {
        MessageBox.Show(UI_WebBrowser.Source.Fragment);
    }


Is it possible that the fragment property requires that there is a string between the path and the #?

Try changing http://www.google.com/#123 to http://www.google.com/ig#123

0

精彩评论

暂无评论...
验证码 换一张
取 消