![](/img/trans.png)
[英]How can I pass an argument from a web page that is loaded inside a web browser applet in a C# program, back to the C# application?
[英]C# Application Parameters from Web Page
我有一个网页和一个桌面应用程序(C#)。 在网页中的单击链接中,打开c#应用程序。
我们需要将数据从网页发送到C#应用程序,C#代码应接收它。
<script type="text/javascript" language="javascript">
<i> function RunFile() {
WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("C:\hehe\ccslabsLogIn, 1, true");
}</i>
</script>
<input type="button" value="Run Notepad" onclick="RunFile();"/>
感谢帮助。
WshShell.Run("C:\hehe\ccslabsLogIn <myString>, 1, true");
只需将<myString>
替换为您要传递的参数即可。
至于处理参数: 如何将命令行参数传递给WinForms应用程序?
对于WPF: WPF命令行参数,一种聪明的方法吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.