我们可以在.net窗口应用程序中运行javascript [英] can we run javascript in .net window application

查看:56
本文介绍了我们可以在.net窗口应用程序中运行javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

如何在winform应用程序中运行java脚本?

你能给我一个例子吗?

Sir,
how to run java script in winform application?
Can you give me an example please?

推荐答案

你为什么要这样?

Javascript是一种在网络浏览器中运行的语言,所以你可以在WebBrowser控件中运行它,如果你真的需要的话。但为什么?为什么让自己的生活变得更复杂 - 你可以在javascript中做的一切,你可以在WinForms中用C#做,而不需要WebBrowser控件的麻烦。

你想要做什么需要这个?
Why would you want to?
Javascript is a language for running in a web browser, so you could run it in a WebBrowser control if you really had to. But why? Why make life more complicated for yourself - everything you can do in javascript, you can do in C# in WinForms without the hassle of a WebBrowser control.
What are you trying to do that need this?




只有当javascript由webbrowser控件加载页面时,才可以从winforms应用程序运行JavaScript。这是一个例子:

http://www.west-wind.com /Weblog/posts/493536.asp [ ^ ]

http://notions.okuda.ca/2009/06/11/calling-javascript-in-a-webbrowser-control-from-c [ ^ ]

问候

Robert
Hi,
you can run JavaScript from your winforms application only if javascript is in page loaded by webbrowser control. here is an example:
http://www.west-wind.com/Weblog/posts/493536.asp[^]
http://notions.okuda.ca/2009/06/11/calling-javascript-in-a-webbrowser-control-from-c[^]
Regards
Robert


再次嗨。

这里有一个提示/技巧:

从WinForms调用JavaScript函数,反之亦然 [ ^ ]

问候

Robert
Hi again.
here is a tip/trick:
Calling JavaScript function from WinForms and vice-versa[^]
Regards
Robert


这篇关于我们可以在.net窗口应用程序中运行javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆