zoukankan      html  css  js  c++  java
  • unity启动第三方软件

    1.比如通过unity来打开迅雷播放一部电影,command 是就迅雷安装路径中的可执行文件,argument就是视频资源路径,其实这就是相当于使用命令行来播放视屏,首先打开播放器,然后把视屏的全路径输入到命令控制中,从而实现unity启动第三方软件,也可以使用openurl直接打开第三方软件
     
    private static void processCommand(string command, string argument){
            ProcessStartInfo start = new ProcessStartInfo(command);
            start.Arguments = argument;
            start.CreateNoWindow = false;
            start.ErrorDialog = true;
            start.UseShellExecute = true;
     
            if(start.UseShellExecute){
                    start.RedirectStandardOutput = false;
                    start.RedirectStandardError = false;
                    start.RedirectStandardInput = false;
            } else{
                    start.RedirectStandardOutput = true;
                    start.RedirectStandardError = true;
                    start.RedirectStandardInput = true;
                    start.StandardOutputEncoding = System.Text.UTF8Encoding.UTF8;
                    start.StandardErrorEncoding = System.Text.UTF8Encoding.UTF8;
            }
     
            Process p = Process.Start(start);
     }
  • 相关阅读:
    C# 四种基本排序算法(冒泡排序,插入排序,选择排序,快速排序)外加折半排序
    jQuery ajax serialize() 方法
    关于问问题
    VIM键位图
    Highcharts选项配置详细说明文档
    awk处理文件内容格式
    【转】如何写出高性能SQL语句
    PHP合并、追加与连接数组
    如何选择web开发语言
    PHP 数据类型验证和获取
  • 原文地址:https://www.cnblogs.com/xwwFrank/p/5660037.html
Copyright © 2011-2022 走看看