Thread: Getting the URL

  1. #1
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470

    Getting the URL

    Hi!

    Is there a way to get the URL when the user opens a web page with a common web browser?

    Thanks.
    GameJolt: https://gamejolt.com/@KasunL
    Game Development Youtube:
    https://is.gd/XyhYoP
    Amateur IT Blog: http://everything-geeky.blogspot.com/



    (and, sorry for my amateur English)

  2. #2

  3. #3
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470
    whoa that was neat, and it works, thanks . Now the problem is for other browsers like Chrome and Firefox. How to do the same thing with other browsers .
    GameJolt: https://gamejolt.com/@KasunL
    Game Development Youtube:
    https://is.gd/XyhYoP
    Amateur IT Blog: http://everything-geeky.blogspot.com/



    (and, sorry for my amateur English)

  4. #4
    Registered User
    Join Date
    Mar 2011
    Posts
    41
    You can use this project which will allow you to use Dynamic Data Exchange with all the browsers. Then you'd use code like
    Code:
    using NDde.Client;
    ... rest of your class ...
        DdeClient dde = new DdeClient("Firefox", "WWW_GetWindowInfo");
        dde.Connect();
        string url = dde.Request("URL", int.MaxValue);
        dde.Disconnect();
    This will work with "IExplore", "Netscape", "Mosaic", "Netscp6", "Mozilla", "Firefox" at the least, don't see any reason why it wouldn't work with Chrome, but you may have to play around with the library if Google didn't use "Chrome" as the DDE name.

    Oh, and compared to the IE method above this is really slow.

Popular pages Recent additions subscribe to a feed