String path = System.IO.Path.GetDirectoryName(fullyQualifiedName);
String path= @"Y:\\Test\\Project\\bin\\Debug"; String[] extract = Regex.Split(path,"bin"); //split it in bin String main = extract[0].TrimEnd('\\'); //extract[0] is Y:\\Test\\Project\\ ,so exclude \\ here Console.WriteLine("Main Path: "+main);//get main path
string s=path.Substring(path.IndexOf('Y'),15);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)