zoukankan      html  css  js  c++  java
  • C#应用程序隐藏调用bat脚本

    做c#应用程序有些调用windows自带的bat脚本会比较方便

    Process proc;
                proc = null;
                try
                {
                    string targetDir = GetParentUrl() + "\Protobuf\"; //文件夹
                    proc = new Process();
                    proc.StartInfo.WorkingDirectory = targetDir;
                    proc.StartInfo.FileName = "callApkTool.bat";
                    //proc.StartInfo.Arguments = string.Format("10");//this is argument
                    proc.StartInfo.CreateNoWindow = true;
                    proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;//这里设置DOS窗口不显示,经实践可行
                    proc.Start();
                    proc.WaitForExit();
                    //labLoading.Visible = false;
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception Occurred :{0},{1}", ex.Message, ex.StackTrace.ToString());
                }
    
  • 相关阅读:
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    Swift
    将Ojective-C代码移植转换为Swift代码
    Swift
    房费制——报表(1)
  • 原文地址:https://www.cnblogs.com/tangyongle/p/7742668.html
Copyright © 2011-2022 走看看