zoukankan      html  css  js  c++  java
  • Process调用winform程序

    调用者:

           string path = @"../temp.exe";
                string Name = @"temp.xml";
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = path;//可执行程序路径
                    p.StartInfo.Arguments = Name;//参数以空格分隔,如果某个参数为空,可以传入""
                    p.StartInfo.UseShellExecute = false;//是否使用操作系统shell启动
                    p.StartInfo.CreateNoWindow = true;//不显示程序窗口
                    p.StartInfo.RedirectStandardOutput = true;//由调用程序获取输出信息
                    p.StartInfo.RedirectStandardInput = true;   //接受来自调用程序的输入信息
                    p.StartInfo.RedirectStandardError = true;   //重定向标准错误输出
                    p.Start();
                    Console.WriteLine(p.StandardOutput.ReadToEnd());  
                    p.WaitForExit();
                }

    被调用者:

    创建一个winform程序

    上面的 p.StartInfo.Arguments 传入的参数就在 Program.cs 中 Main 中的 args 参数

    这样取值:
    args[0] args[1] args[2] ..........

    想使用WebBrowser是要在Form中加载对象

  • 相关阅读:
    神经网络量化入门--激活函数
    自我介绍+软工五问
    Myapp
    自我介绍+软工5问
    需求改进&系统设计
    团队展示&选题
    结对编程(java实现)
    个人项目-wc
    自我介绍+软工5问
    团队项目介绍
  • 原文地址:https://www.cnblogs.com/mi21/p/14097582.html
Copyright © 2011-2022 走看看