그래서, 나는경로에서 파일 이름과 확장명을 추출하는 방법?
string path = "C:\\Program Files\\Program\\File.exe";
하는 방법은 "FILE.EXE"어떻게해야합니까이 있다고? 나눠 봤지만 (아래 참조) 무언가를 생각하고 있었지만 시도한 것은 작동하지 않습니다 ...
이것은 내 코드입니다.
List<string> procs = new List<string>(); //Used to check if designated process is already running
foreach (Process prcs in Process.GetProcesses())
procs.Add(prcs.ProcessName); //Add each process to the list
foreach (string l in File.ReadAllLines("MultiStart.txt")) //Get list of processes (full path)
if (!l.StartsWith("//")) //Check if it's commented out
if (!procs.Contains(l.Split('\\')[l.Split('\\').Length - 1])) //Check if process is already running
Process.Start(l);
나는 아마도 멍청한 놈일뿐입니다. ._.
내 코드 Path.GetFileNameWithoutExtension 필요하지만 감사 ... – CrimsonDeath
그건 무슨 요 아니에요. 그러나 UR 질문은 말했다. – Joey