Fixed GetUNCServer

pull/83/head
David Hall 2019-07-16 07:43:32 -06:00
parent ceff4504f0
commit 1c8ea5836d
1 changed files with 1 additions and 5 deletions

View File

@ -182,11 +182,7 @@ namespace Vanara.IO
/// </summary>
/// <param name="path">The UNC path.</param>
/// <returns>On success, the server portion of the UNC path. On failure, <see langword="null"/> is returned.</returns>
public static string GetUNCServer(string path)
{
var sb = new StringBuilder(MAX_PATH, MAX_PATH);
return PathIsUNCEx(path, ref sb) ? sb.ToString() : null;
}
public static string GetUNCServer(string path) => PathIsUNCEx(path, out var ptr) ? StringHelper.GetString(ptr, System.Runtime.InteropServices.CharSet.Unicode, path.Length) : null;
/// <summary>
/// Searches a path to determine if it contains a valid prefix of the type passed by <paramref name="prefix"/>. A prefix is one of