Page 1 of 1

WebBrowser Errors - VB 2008

Posted: Sat Oct 18, 2008 3:25 pm
by Click16
I need a bit of help... Lets just say i make a simple application.

Includes:
Webbrowser
textbox1
button1
panel1
_________
Coding:
Button 1 : Me.Webbrowser1.navigate(me.textbox1.text)
_________
Testing:
It works for the most part but if i click a link watch what happens:
Image

after its clicked
Image

Please, i need some help. i tried all i could and nothing worked

thanks

Re: WebBrowser Errors - VB 2008

Posted: Sat Oct 18, 2008 4:54 pm
by Aumaan Anubis
It's because Mozilla is set as your default browser.

And no, I have no idea how to fix it.

Re: WebBrowser Errors - VB 2008

Posted: Sat Oct 18, 2008 6:30 pm
by XZodia
A long time ago, I spent a fair amount of time trying to solve is but as far as I'm aware its not possible.

Re: WebBrowser Errors - VB 2008

Posted: Sat Oct 18, 2008 7:17 pm
by Gary
I know it is, I know someone who made a Web Browser.
I'll Ask him.

Re: WebBrowser Errors - VB 2008

Posted: Sat Oct 18, 2008 8:07 pm
by OwnZ joO
Why are you trying to make a browser out of the .net one anyway, why don't you just use Firefox? If you were making the whole thing by yourself and not using the .Net WebBrowser control there would be a learning experience in it, but this is just reinventing the wheel by taking someone elses and then taking out features...

Re: WebBrowser Errors - VB 2008

Posted: Sun Oct 19, 2008 1:04 am
by Click16
It's not that. I am still working of FTP Pro and i need to be able to open folders in the Xbox browser in order for this to work right.

The connect to system is FAR more advanced. Allowing you to select where you want to go!
Example:
Connect To> [Xbox name]>[Directory]>[Games]>[folder name]>Maps

or for application sending.
Connect To> [Xbox name]>[Directory]>[Apps]

If you want a preview picture of what its becoming.
Image

Re: WebBrowser Errors - VB 2008

Posted: Sun Oct 19, 2008 11:47 am
by Prey
It's quite possible :)

Code: Select all

    Private Sub WebBrowser1_NewWindow(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow

        ' Stop the opening of a new window.
        e.Cancel = True

        ' If the user clicked a link, navigate to it in the current window.
        Dim curElement As HtmlElement = WebBrowser1.Document.ActiveElement
        If curElement.TagName.ToLower() = "a" Then
            Dim linkStr As String = curElement.GetAttribute("href")
            WebBrowser1.Navigate(linkStr)
        End If

    End Sub

Re: WebBrowser Errors - VB 2008

Posted: Tue Oct 28, 2008 12:30 am
by Click16
this works for a web browser but doesn't work for ftping to your xbox. it gives me the same results.

Re: WebBrowser Errors - VB 2008

Posted: Tue Oct 28, 2008 12:52 pm
by Prey
I'm sure you can modify it to work for you. Take a look at the WebBrowser.Document and other properties to see what you can hook onto instead of 'a'.

Re: WebBrowser Errors - VB 2008

Posted: Tue Oct 28, 2008 1:07 pm
by DarkShallFall
Who the fuck plays that game. gash!!!

Re: WebBrowser Errors - VB 2008

Posted: Mon Nov 24, 2008 12:35 am
by xxpenguinxx
Prey wrote:It's quite possible :)

Code: Select all

    Private Sub WebBrowser1_NewWindow(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow

        ' Stop the opening of a new window.
        e.Cancel = True

        ' If the user clicked a link, navigate to it in the current window.
        Dim curElement As HtmlElement = WebBrowser1.Document.ActiveElement
        If curElement.TagName.ToLower() = "a" Then
            Dim linkStr As String = curElement.GetAttribute("href")
            WebBrowser1.Navigate(linkStr)
        End If

    End Sub
I know I'm bumping an old topic but how do I convert that to C#? That may sound stupid but I just started learning C# and all the tuts I've found were the very basics.

Re: WebBrowser Errors - VB 2008

Posted: Mon Nov 24, 2008 7:02 am
by OwnZ joO
[code]
private void webBrowser1_NewWindow(object sender, CancelEventArgs e)
{
// stop the opening of a new window
e.Cancel = true;

// if the user clicked a link, naviage to it in the current window
HtmlElement curElement = WebBrowser1.Document.ActiveElement;
if(curElement.TagName.ToLower() == "a")
{
string linkStr = curElement.GetAttribute("href");
WebBrowser1.Navigate(linkStr);
}
}
[/code]

Re: WebBrowser Errors - VB 2008

Posted: Wed Nov 26, 2008 4:04 am
by Click16
Ok well all of this info is good and stuff, but it still doesn't solve my problem. I need to know how a real FTP Program would work. (Smart FTP Client, Flash FXP, FileZilla, etc.)