【问题标题】:C# Application Parameters from Web Page来自网页的 C# 应用程序参数
【发布时间】:2014-12-01 02:31:00
【问题描述】:

我有一个网页和一个桌面应用程序 (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();"/>

感谢您的帮助。

【问题讨论】:

  • 嗨,欢迎来到 SO!向我们展示您迄今为止编写的代码。没有人会从头开始为您编写代码。这是一个故障排除站点,而不是免费编码!

标签: javascript c# web


【解决方案1】:
WshShell.Run("C:\hehe\ccslabsLogIn <myString>, 1, true");

只需将&lt;myString&gt; 替换为您要传递的参数即可。

关于处理论点: How do I pass command-line arguments to a WinForms application?

对于 WPF: WPF Command Line Arguments, a smart way?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-21
    • 2014-01-21
    • 2010-09-06
    • 2011-03-10
    • 1970-01-01
    • 1970-01-01
    • 2011-02-28
    • 1970-01-01
    相关资源
    最近更新 更多