Like Tree1Likes
  • 1 Post By Momerath

Getting the URL

This is a discussion on Getting the URL within the C# Programming forums, part of the General Programming Boards category; Hi! Is there a way to get the URL when the user opens a web page with a common web ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    365

    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.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

  2. #2

  3. #3
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    365
    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 .
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature 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.
    geek@02 likes this.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21