Nimesh Parmar
Nimesh Parmar

Reputation:

Get current URL from Browser

I'm developing new cafe software in VB.Net and I need to get the url from the web browser. How can I get the current url from any web browser using VB.Net only? (Not ASP.NET)

Upvotes: 0

Views: 3525

Answers (3)

Stefan
Stefan

Reputation: 11519

Check out DDE (Dynamic Data Exchange). Most browsers supports DDE.
Here are a .Net library you can use: http://ndde.codeplex.com/
And WWW_GetWinfowInfo is the DDE-message you will be using.

Another possible method is to use Windows API (Getwindow, getchildwindow, gettext and so on) to keep track of different browsers whereabouts. If its possible, it much work and it will be needed to be coded separately for each browser (and even different code between versions of same browser).

Best way is to use the webbrowser control as John Saunders answer tells about.

Now, it could help us if you write WHY you want to know the URLs. Is it about to stop the user to browse some blacklisted URLs, then you can use windows SteadyState from Microsoft.

In a matter of fact, If you are building a kiosk-app, then SteadyState can be a great app to install, because it has a lots of kiosk-app-funktions ready to use and is free. It can hide drives, protect disks, remove all changes when user logges out. block programs, set session timers to let the user only have x minutes before a mandatory logoff, restrict allmost whatewer you want. Its the first aid kit to make the computer allmost unbreakable when being leaved in the public.

Here are some of the features:

Windows Disk Protection – Help protect the Windows partition, which contains the Windows operating system and other programs, from being modified without administrator approval. Windows Disk Protection helps protect the Windows operating system and all files on the computer from permanent change. Any changes made by shared users when they are logged on to the computer are removed when the computer is restarted. Windows SteadyState allows you to set Windows Disk Protection to remove all changes upon restart, to remove changes at a certain date and time, or to not remove changes at all.

User Restrictions and Settings – The user restrictions and settings can help to enhance and simplify the user experience. Restrict user access to programs, settings, Start menu items, and options in Windows XP. You can also lock shared user accounts to prevent changes from being retained from one session to the next.

User Account Manager – Create and delete user accounts. You can use Windows SteadyState to create user accounts on alternative drives that will retain user data and settings even when Windows Disk Protection is turned on. You can also import and export user settings from one computer to another—saving valuable time and resources. Computer Restrictions – Control security settings, privacy settings, and more, such as preventing users from creating and storing folders in drive C and from opening Microsoft Office documents from Internet Explorer.

Download link: http://www.softwarepatch.com/windows/steady-state-windows-xp.html

Upvotes: 0

John Saunders
John Saunders

Reputation: 161821

Maybe you should consider writing a Windows Forms program and hosting the WebBrowser Control in the form. That way, you'll have all the control you want. In fact, you get to add the forward and back buttons and all the "UI" stuff on your own, and use them to control the WebBrowser Control.

It took me about 15 minutes last time I tried.

Upvotes: 1

Joel Coehoorn
Joel Coehoorn

Reputation: 416121

Which browser? Which instance? Which tab? I typically have at least three different kinds of browser open (some things here at work require IE, I use Chrome for surfing SO sites, and Firefox for most everything else), and each of those will likely multiple tabs open. Even (or especially) at a cyber cafe, users will want to be able to use the browser(s) of their choice.

Upvotes: 0

Related Questions