WebBrowser Errors - VB 2008

Discuss anything programming related.
Post Reply
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

WebBrowser Errors - VB 2008

Post 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
Image
User avatar
Aumaan Anubis
Staff
Posts: 1812
Joined: Thu Dec 13, 2007 12:18 am
Contact:

Re: WebBrowser Errors - VB 2008

Post by Aumaan Anubis »

It's because Mozilla is set as your default browser.

And no, I have no idea how to fix it.
User avatar
XZodia
Staff
Posts: 2208
Joined: Sun Dec 09, 2007 2:09 pm
Location: UK
Contact:

Re: WebBrowser Errors - VB 2008

Post 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.
Image
JacksonCougar wrote:I find you usually have great ideas.
JacksonCougar wrote:Ah fuck. Why must you always be right? Why.
User avatar
Gary
Posts: 1946
Joined: Thu Feb 14, 2008 10:17 pm
Location: USA, FL
Contact:

Re: WebBrowser Errors - VB 2008

Post by Gary »

I know it is, I know someone who made a Web Browser.
I'll Ask him.
User avatar
OwnZ joO
Posts: 1197
Joined: Sun Dec 09, 2007 4:46 pm

Re: WebBrowser Errors - VB 2008

Post 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...
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: WebBrowser Errors - VB 2008

Post 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
User avatar
Prey
Posts: 129
Joined: Sat Dec 29, 2007 5:06 pm
Location: UK

Re: WebBrowser Errors - VB 2008

Post 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
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: WebBrowser Errors - VB 2008

Post by Click16 »

this works for a web browser but doesn't work for ftping to your xbox. it gives me the same results.
User avatar
Prey
Posts: 129
Joined: Sat Dec 29, 2007 5:06 pm
Location: UK

Re: WebBrowser Errors - VB 2008

Post 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'.
DarkShallFall
Posts: 710
Joined: Thu Jan 03, 2008 5:29 pm

Re: WebBrowser Errors - VB 2008

Post by DarkShallFall »

Who the fuck plays that game. gash!!!
xxpenguinxx
Posts: 1974
Joined: Sun Jan 27, 2008 4:50 am

Re: WebBrowser Errors - VB 2008

Post 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.
DemonicSandwich wrote:See that? You see that how it is highlighted down here but it's not highlighted right there? Ah, I guess that's what I get for pirating it.
In Soviet Russia, DS touches you. Say it again and I'll do more than touch. ~DS -Oh baby
A cat was licking itself to the sound of potato chips.
User avatar
OwnZ joO
Posts: 1197
Joined: Sun Dec 09, 2007 4:46 pm

Re: WebBrowser Errors - VB 2008

Post 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]
User avatar
Click16
Posts: 1941
Joined: Mon Dec 31, 2007 4:36 am
Location: United States

Re: WebBrowser Errors - VB 2008

Post 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.)
Image
Post Reply