Link to home
Start Free TrialLog in
Avatar of nwhan
nwhan

asked on

inform user that only Internet Explorer can be used to access system

My system requires only Internet Explorer to be used, other browsers like Mozilla/Opera cannot be supported.

I need to check if user uses IE browser. Else, i need to popup a message to inform user that only Internet Explorer can be used to access the system. How can I do the checkings ?

Please help on the codes. Thanks.
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Hi nwhan,

1. You could look it up in the registry at the HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer.
2. If the key exists, IE is installed on the computer. To see if it is the default handler you can check the HKEY_CLASSES_ROOT\htmlfile to see the name, that will probably be "HTML document" and check out "HKEY_CLASSES_ROOT\htmlfile\shell\open\command".
3. If the key contains "iexplore.exe" you know that IE is also the default browser.

if 1 or 3 is negative then you can show a message

hope this helps a bit
bruintje
for code to check on ie installed

add these 2 in the top of your form
---------
Imports Microsoft.Win32.Registry
Imports Microsoft.Win32
---------

and this is the button code i used

---------
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  Dim regKey As RegistryKey
  Try
    regKey = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Internet Explorer", True)
    regKey.Close()
  Catch ex As Exception
    MessageBox.Show("Internet Explorer was not found on this machine")
  Finally

  End Try

End Sub
---------

hope this helps a bit
bruintje
Avatar of nwhan
nwhan

ASKER

Sorry if my question is abit blur or incomplete.
I have a web-based system that supports only Internet Explorer.
Therefore, if a user accesses the system using other browser like Firefox or Opera, the page should display a message telling user that "Other browser has been detected other than IE. Please use only IE to access the system."

Please help. Thanks.
this is ASP.NET?
Avatar of nwhan

ASKER

Really ?
Anyway I am using Microsoft Visual Studio (VB.NET)
So is this VB.NET or ASP.NET ? Whats the difference ?
no i was asking :)

the code i gave checked if IE was installed or not in VB

but then you said:
>>the page should display a message telling user that "Other browser has been detected other than IE. Please use only IE to access the system."

so i assumed the page was a webpage and you used ASP for the webpage and i used a windows form to prepare the code
Avatar of nwhan

ASKER

Sorry for not mentioning that it's a web-based system. So how can i perform the checkings and notify user to use only IE ? Help please. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial