private static bool SeachOnPath(string path, out string fullPath) { StringBuilder sb = new StringBuilder(path, PathResolveHelper.MaxPath); if (NativeMethods.PathFindOnPath(sb, null)) { var mbpath = sb.ToString(); if (PathResolveHelper.Exists(mbpath, out fullPath)) { return(true); } } fullPath = null; return(false); }
private static bool TrySeachInPath(string path, string fileName, string extension, out string fullPath) { StringBuilder sb = new StringBuilder(PathResolveHelper.MaxPath); NativeMethods.SearchPath(path, fileName, extension, sb.Capacity, sb, out var ptr); if (ptr != IntPtr.Zero) { if (PathResolveHelper.Exists(sb.ToString(), out fullPath)) { return(true); } } fullPath = null; return(false); }