Add LocalResourceFinder.

This commit is contained in:
2022-12-16 17:41:23 +08:00
parent 7f2cfe94c1
commit 8eb0b11027
9 changed files with 140 additions and 0 deletions

View File

@@ -44,5 +44,21 @@ namespace Cryville.Common {
if (result.Length == 0) return "_";
return result;
}
/// <summary>
/// Gets the process path from a command.
/// </summary>
/// <param name="command">The command.</param>
/// <returns>The process path.</returns>
public static string GetProcessPathFromCommand(string command) {
command = command.Trim();
if (command[0] == '"') {
return command.Substring(1, command.IndexOf('"', 1) - 1);
}
else {
int e = command.IndexOf(' ');
if (e == -1) return command;
else return command.Substring(0, e);
}
}
}
}