Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get MAC address through Silverlight 4

i tried doing this- http://thewayithink.co.uk/post/2010/05/04/Mac-Address-in-Silverlight-4.aspx

but the 3 conditions are always false :

if ((Application.Current.IsRunningOutOfBrowser) && 

(Application.Current.HasElevatedPermissions) && 
(AutomationFactory.IsAvailable))

i guess its because of permissions and security stuff.. is there any way i can get the physical IP address off the client's side? as i said, i use silverlight 4.

like image 334
sergey yefimov Avatar asked Dec 10 '25 13:12

sergey yefimov


1 Answers

The security model of Silverlight is such that you can't access anything from the client machine outside the browser sandbox and the (small) amount of disk space allocated to isolated storage. The client machine's MAC address would fall into that category. You can however run your application "Out of Browser" (OOB) with elevated privileges which is what this test is checking for.

The first condition states that you must be running out of browser - so the first question is "Is your application OOB enabled and running out of broswer?".

If not then the test will fail.

Then if the application is running OOB it must also be running with elevated permissions. Is this the case?

As for the AutomationFactory test - the answer on this post implies that it will be true when the application is running out of browser with elevated permissions.

like image 115
ChrisF Avatar answered Dec 12 '25 04:12

ChrisF