admin管理员组文章数量:1300049
I created a c# class library. I need to to call a method in the library file javascript using the dll.The javascript will be embedded in a web page already created. The dll will be on the client machine. Can someone help?
Ps:the method returns a boolean
More details: Actually the website is a virtual web conferencing software in which each one has a particualr avatar. I have to detect whether a particular software(needed for making video calls) is installed in the user's system.If it is installed i have to indicate that by showing some special symbols on his avatar.I made a c# class library which returns "true" if the software is installed in the system.Now i have to embed this in the virtual conferencing web software
I am new to c# and javascript programming!
I created a c# class library. I need to to call a method in the library file javascript using the dll.The javascript will be embedded in a web page already created. The dll will be on the client machine. Can someone help?
Ps:the method returns a boolean
More details: Actually the website is a virtual web conferencing software in which each one has a particualr avatar. I have to detect whether a particular software(needed for making video calls) is installed in the user's system.If it is installed i have to indicate that by showing some special symbols on his avatar.I made a c# class library which returns "true" if the software is installed in the system.Now i have to embed this in the virtual conferencing web software
I am new to c# and javascript programming!
Share Improve this question edited Aug 11, 2011 at 9:59 Kai asked Aug 11, 2011 at 9:45 KaiKai 9936 gold badges16 silver badges41 bronze badges 4- Can you be a little more specific? Will this web page just be browsed to or is it hosted in some way like through a WebBrowser control? – Lloyd Commented Aug 11, 2011 at 9:48
- Is the DLL COM Visible? Does the web browser have weak security? You should keep the DLL server side and call it with AJAX perhaps. – Jodrell Commented Aug 11, 2011 at 9:48
- Such behavior is not fit for public websites. – Shadow Wizzard Commented Aug 11, 2011 at 9:59
- 3 "I am new to c# and javascript programming!" + Invoking DLLs on user-system from websites = security disaster ready to happen. – aero Commented Aug 11, 2011 at 11:31
2 Answers
Reset to default 3Use the ActiveXObject class: http://www.dreamincode/forums/topic/38890-activex-with-c%23/
Possible solution:
You need to register your dll at the destination puter. Than in js you need to create ActiveX object with the same registered name
var ObjFromDll = new ActiveXObject("DllRegisteredName");
and call it's method.
var anyResult = ObjFromDll.MyMethod()
本文标签: cHow to call the methods in a dll from javascriptStack Overflow
版权声明:本文标题:c# - How to call the methods in a dll from javascript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741653829a2390635.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论