From 17eba24fc5bcfd7f979e3f2eff01c5c6fb36039d Mon Sep 17 00:00:00 2001 From: lilium-saber Date: Tue, 26 Sep 2023 20:27:43 +0800 Subject: [PATCH] can to use cmd Signed-off-by: lilium-saber --- src/ScnToJson/TranslationScnToJson.cs | 38 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/ScnToJson/TranslationScnToJson.cs b/src/ScnToJson/TranslationScnToJson.cs index 63dc36e..c5f91a7 100644 --- a/src/ScnToJson/TranslationScnToJson.cs +++ b/src/ScnToJson/TranslationScnToJson.cs @@ -1,27 +1,33 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Printing; -using System.Text; -using System.Threading.Tasks; +using System.Diagnostics; namespace WpfApp1.ScnToJson { internal class TranslationScnToJson { - private String spath;//scn路径 - private String dpath;//json路径 - private String cmdHandle = "cd ";//cmd命令字符串 + private string spath;//scn路径 + private string dpath;//json路径 + private string cmdHandle = "cd E:\\programingg\\vsprogam\\testRjgc\\VNT\\VNTextPatch";//cmd命令字符串 + private string voice = ".\\VNTextPatch extractlocal E:\\programingg\\vsprogam\\testRjgc\\VNT\\p1 E:\\programingg\\vsprogam\\testRjgc\\VNT\\p2";//VNTextPatch extractlocal - var p = new Process + public void StartTrans() { - StartInfo = + var p = new Process { - FileName = "cmd.exe", - WorkingDirectory = @"/c " + this.cmdHandle, - } - }; + StartInfo = + { + FileName = "PowerShell.exe", + Arguments = "/c " + cmdHandle + "\n" + voice, + UseShellExecute = false, + CreateNoWindow = false, + } + }; + p.Start(); + p.WaitForExit(); + p.Close(); + + } + + }