तो, मैंसी # - पथ से फ़ाइल नाम और एक्सटेंशन निकालने के लिए कैसे?
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
यह नहीं है कि यो आपका सवाल कहा, यद्यपि। – Joey