Commit 10f11264 authored by 陈创杰's avatar 陈创杰

Merge branch 'master' of git@gitlab.sd-zeus.com:1649090050/Zsnewcentury.git

parents de6bd64c 94e32bf7
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using UnityEngine;
public class ProgressUntily : MonoBehaviour
{
Process process = new Process();
public void CallProress(string path,string arg)
{
try
{
process.StartInfo.UseShellExecute = false;
process.StartInfo.FileName = path;
process.StartInfo.Arguments =arg;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
}catch(Exception e)
{
UnityEngine.Debug.Log(e);
}
}
}
fileFormatVersion: 2
guid: 1e04173512e4bde409202367429838f6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using TMPro;
public class TestUrl : MonoBehaviour
{
public TMP_Text url_text;
ProgressUntily progressUntily = new ProgressUntily();
// Start is called before the first frame update
void Start()
{
//init();
Debug.Log("E://20230823//Zsnewcentury.exe");
progressUntily.CallProress("E://20230823//Zsnewcentury.exe", "");
}
// Update is called once per frame
void Update()
{
}
public void init()
{
/* //1.获取模块的完整路径。
string path = "1.获取模块的完整路径 \r\n System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName \r\n" + System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName + "\r\n\r\n";
//2.获取和设置当前目录(该进程从中启动的目录)的完全限定目录
path += "2.获取和设置当前目录(该进程从中启动的目录)的完全限定目录 \r\n System.Environment.CurrentDirectory \r\n" + System.Environment.CurrentDirectory + "\r\n\r\n";
//3.获取应用程序的当前工作目录
path += "3.获取应用程序的当前工作目录 \r\n System.IO.Directory.GetCurrentDirectory() \r\n" + System.IO.Directory.GetCurrentDirectory() + "\r\n\r\n";
//4.获取程序的基目录
path += "4.获取程序的基目录 \r\n System.AppDomain.CurrentDomain.BaseDirectory \r\n" + System.AppDomain.CurrentDomain.BaseDirectory + "\r\n\r\n";
//5.获取和设置包括该应用程序的目录的名称
path += "5.获取和设置包括该应用程序的目录的名称 \r\n System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase \r\n" + System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "\r\n\r\n";
//6.获取启动了应用程序的可执行文件的路径
path += "6.获取启动了应用程序的可执行文件的路径 \r\n System.Windows.Forms.Application.StartupPath \r\n" + System.Windows.Forms.Application.StartupPath + "\r\n\r\n";
// 7.获取启动了应用程序的可执行文件的路径及文件名
path += "7.获取启动了应用程序的可执行文件的路径及文件名 \r\n System.Windows.Forms.Application.ExecutablePath \r\n" + System.Windows.Forms.Application.ExecutablePath + "\r\n\r\n";
//8、获取当前进程的完整路径,包含文件名(进程名)
path += "8.获取当前进程的完整路径,包含文件名(进程名) \r\n this.GetType().Assembly.Location \r\n" + this.GetType().Assembly.Location + "\r\n\r\n";
url_text.text = path;
*/
}
}
fileFormatVersion: 2
guid: d89de17f14bc7224e80353a9969236d3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
fileFormatVersion: 2
guid: 009df3ba69555d0479387b5b00c5497d
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment