Tak, że mamC# - Jak wyodrębnić nazwę pliku i rozszerzenie ze ścieżki?
string path = "C:\\Program Files\\Program\\File.exe";
Jak mogę dostać tylko "file.exe"? Myślałem o czymś z podziałem (zobacz poniżej), ale to, co próbowałem, nie działa ...
To jest mój kod.
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);
Prawdopodobnie po prostu jestem noobem. ._.
Mój kod wymagał Path.GetFileNameWithoutExtension, ale dzięki ... – CrimsonDeath
To nie jest tak ale jedno pytanie. – Joey