通过Silverlight 4获取MAC地址
我尝试这样做- http://thewayithink.co.uk /post/2010/05/04/Mac-Address-in-Silverlight-4.aspx
但 3 个条件始终为 false:
if ((Application.Current.IsRunningOutOfBrowser) &&
(Application.Current.HasElevatedPermissions) &&
(AutomationFactory.IsAvailable))
我猜是因为权限和安全问题。 有什么办法可以从客户端获取物理IP地址吗? 正如我所说,我使用 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Silverlight 的安全模型使您无法从浏览器沙箱和分配给隔离存储的(少量)磁盘空间之外的客户端计算机访问任何内容。客户端计算机的 MAC 地址就属于该类别。不过,您可以使用提升的权限“在浏览器外”(OOB) 运行您的应用程序,这正是此测试要检查的内容。
第一个条件表明您必须耗尽浏览器 - 因此第一个问题是“您的应用程序是否已启用 OOB 并且耗尽浏览器?”。
如果不是,那么测试将失败。
然后,如果应用程序正在运行 OOB,它也必须以提升的权限运行。是这样吗?
至于 AutomationFactory 测试 - 这篇文章 上的答案意味着它将当应用程序在具有提升权限的浏览器中运行时为 true。
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.
使用来自此链接(此处也提到了这个问题)。
use this code sample which is from this link (the question is also mentioned here).