12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Utilities;
- namespace SMBLibrary.Server
- {
- public class ServerPathUtils
- {
-
-
- public static string GetRelativeServerPath(string path)
- {
- if (path.StartsWith(@"\\"))
- {
- int index = path.IndexOf('\\', 2);
- if (index > 0)
- {
- return path.Substring(index);
- }
- else
- {
- return String.Empty;
- }
- }
- return path;
- }
-
-
- public static string GetRelativeSharePath(string path)
- {
- if (path.StartsWith(@"\\"))
- {
- int firstIndex = path.IndexOf('\\', 2);
- int index = path.IndexOf('\\', firstIndex + 1);
- if (index > 0)
- {
- return path.Substring(index);
- }
- else
- {
- return path;
- }
- }
- return path;
- }
- }
- }
|