// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.IO; namespace E { public class Program { public static bool Regular(string fnm) { try { DriveInfo di = new DriveInfo(Path.GetPathRoot(Path.GetFullPath(fnm))); return di.DriveType != DriveType.Unknown; } catch (Exception) { return false; } } public static void Test(string fnm) { Console.WriteLine(fnm + " : " + Regular(fnm)); } public static void Main(string[] args) { Test(@"C:\z.z"); Test("z.z"); Test("LPT1:"); } } }