开发者

Use IronPython to access COM object in a browser?

开发者 https://www.devze.com 2023-02-10 22:55 出处:网络
I am trying to use a COM object by IronPython in a browser. I have tried the following code in ipy.exe and it works fine:

I am trying to use a COM object by IronPython in a browser. I have tried the following code in ipy.exe and it works fine:

from System import T开发者_StackOverflow中文版ype, Activator
Activator.CreateInstance(Type.GetTypeFromProgID("Word.Application"))

But if I use the code a a browser like this:

<html>
<script type="text/python"> 
from System import Type, Activator
Activator.CreateInstance(Type.GetTypeFromProgID("Word.Application"))
</script>
</html>

It just doesn't work.

I want to know if there are restrictions when using IronPython in a browser. Did I miss something?


Silverlight, which is what allows IronPython in the browser has strict security. Silverlight's sandbox requires the IronPython code to run in an internet domain (localhost included), but not the local domain (directly from the file-system). You might find some more information from Jimmy Schementi's blog.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号