96
if (p[0]==cDIR && p[1]==cDIR && Char.IsLetter(p[2]) && p.Length >= 5 &&idx3rd > -1 && Char.IsLetter(p[idx3rd+1]) && p.IndexOf(cDIR, idx3rd + 2) > -1)
1
using System;
2
3
public static class Program
4
{
5
const string ShareExtUNCFullPrefix = @"\\?\UNC\";
6
const string ShareExtPrefix = @"\\?\";
7
const string SharePrefix = @"\\";
8
const string DIR = @"\";
9
const char cDIR = '\\';
10
const string DIRDOUBLE = @"\\";
11
const string COLONDIR = @":\";
12
const string COLON = @":";
13
const char cCOLON = ':';
14
const string DIRSPACE = @"\ ";
15
const string SPACEDIR = @" \";
16
const string SPACE = @" ";
17
18
public static int IndexOfOccurence(this string s, char match, int occurence)
19
{
20
int i = 1;
21
int index = -1;
22
23
while (i <= occurence && (index = s.IndexOf(match, index + 1)) != -1)
24
{
Cached Result
\\host\share
\\host\share
\\h\s
\\h\s
\\share\tail, 1 failed case - UNC is Server Name
\\host\share
\\h\s
\\h\s
\\share\tail, 1 failed case - UNC is Server Name