Hi, How can i detected the browser type in my silverlight application?
for example i want to know if my silverlight application is running on IE or Firefox Or GoogleChrome...
i'm using silverlight 4 and my programming language is c#
Hi, How can i detected the browser type in my silverlight application?
for example i want to know if my silverlight application is running on IE or Firefox Or GoogleChrome...
i'm using silverlight 4 and my programming language is c#
Use the HtmlPage.BrowserInformation
property.
Code Example (given a TextBlock
called "txtOut"):-
txtOut.Text = String.Format("Name: {0}\nVersion: {1}\nProduct Name: {2}\nProduct Version: {3}\nUser Agent: {4}\nPlatform: {5}",
HtmlPage.BrowserInformation.Name,
HtmlPage.BrowserInformation.BrowserVersion,
HtmlPage.BrowserInformation.ProductName,
HtmlPage.BrowserInformation.ProductVersion,
HtmlPage.BrowserInformation.UserAgent,
HtmlPage.BrowserInformation.Platform);
I have IE 7 and Firefox 3.6.6 and it would seem that ProductName
and possible ProductVersion
would be you best choice to determine the browser.
If you are using Jquery or java script, then you can use navigator.appName for getting name of the browser.