使用 Silverlight 打开 .exe
我试图让 silverlight 打开屏幕键盘。我编写了一段代码,但它抛出了 System.InvalidOperationException。
try
{
HtmlPage.Window.Eval("var myshell = new ActiveXObject( 'WScript.shell' ); myshell.run( '" + OSK + "' );");
}
catch (Exception ex)
{
textBox1.Items.Add(ex.ToString());
}
我做错了什么?
Im trying to get silverlight to open the OnscreenKeyboard. I wrote a code but it is throwing a System.InvalidOperationException.
try
{
HtmlPage.Window.Eval("var myshell = new ActiveXObject( 'WScript.shell' ); myshell.run( '" + OSK + "' );");
}
catch (Exception ex)
{
textBox1.Items.Add(ex.ToString());
}
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您被 IE 内置的安全功能阻止了。 Internet Explorer 只允许使用
ActiveXObject
构造一些受信任的COM 对象。您能想象如果某个网站获得您想做的事情的许可,可能会造成严重破坏吗?You are being blocked by the security built in to IE. Internet Explorer will only allow a few trusted COM objects to be constructed with
ActiveXObject
. Could you imagine the havoc that could be wrought if a website had the permission to do what you are trying to do?