Results 1 to 4 of 4

Thread: Webbrowser URL

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    78

    Webbrowser URL

    Hi,

    I want to be able to capture the URL of the webpage a user has gone to in my webbrowser control. I can do that easy enough by doing:

    AxWebBrowser1.LocationURL.ToString

    when its a typical webpage.

    However some webpages that the user will be going to have a different URL (shown in the address bar) to what the actual actual URL is of the webpage.

    EG.

    A link on a website points to the following URL:

    https://www.mywebsite.com/logon/Tran...x?CID=91&SID=2

    (which is shown in the status bar when the mouse hovers over the link)
    when you actually go to that webpage the URL in the address bar is:

    https://www.mywebsite.com/logon/reports

    I want to be able to get the "https://www.mywebsite.com/logon/Transfer.aspx?CID=91&SID=2" URL, not the other one which is brought back by:

    AxWebBrowser1.LocationURL.ToString

    because it is this URL that will take you to that webpage not 'https://www.mywebsite.com/logon/reports' which will not take you anywhere.

    Does anyone know how I could do this?

  2. #2
    Fanatic Member
    Join Date
    Jun 2003
    Location
    Worcester, MA
    Posts
    782
    if you call he box for the url txtUrl and then havea list caled lstBeenTo you could do


    VB Code:
    1. Timer1_Enabled
    2. lstBeenTo.additem = txtUrl.text
    C#.net, VB, C++, Java, VS 2005/2008
    Dont' forget to rate posts that are helpful to you.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2003
    Posts
    78
    Cheers but I don't think that really helps, unless I don't get what you mean.

    I need to know how to get the URL in the first place because it seems that:


    AxWebBrowser1.LocationURL.ToString

    will only give me
    https://www.mywebsite.com/logon/reports
    (the url in the address bar)
    not
    https://www.mywebsite.com/logon/Tra...px?CID=91&SID=2
    (the actual url shown in status bar when use hovers ovver the link)

    Cheers anyway

    Any of you guys got any more ides

  4. #4
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963
    I remember there's an AddressBar property in webbrowser
    u might try playin' wif that

    Or how about when the NavigateComplete event is fired,
    u get the URL by WebBrowser.LocationURL

    Or how about during BeforeNavigate event, u can get the
    URL through the URL parameter
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width