Is there a managed API for kernel32.searchpath? i.e not using a pinvoke.
相关问题
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- 'System.Threading.ThreadAbortException' in
- Bulk update SQL Server C#
- Should I use static function in c# where many call
You can use DirectoryInfo.GetFiles(String searchPattern, SearchOption searchOption). To get all of the *.exe files in a directory including subdirectories, you could use:
Take a look at the MSDN documentation at http://msdn.microsoft.com/en-us/library/ms143327.aspx
Not really, unless you count re-implementing the entire logic of the function in C# yourself which would be a waste of time, IMO, when a couple of lines of P/Invoke would do it just as well.