diff --git a/Program.cs b/Program.cs index aac610c..afc9b6e 100644 --- a/Program.cs +++ b/Program.cs @@ -49,16 +49,24 @@ namespace LocalExplorer //protocol handler, replace it with an actual space. path = path.Replace("%20", " "); + //Replace / with \ to support proper unc + path = path.Replace("/", "\\"); + + //If the URL contains a #, + //Trim out everything after # including the # + if(path.Contains("#")) + { path = path.Substring(0, path.IndexOf("#")); } + WriteOutputFile($"arg passed: {path}"); //Determine if file or directory. //Check to see if the directory or file exists. if (Directory.Exists(path)) - { bDirectoryExists = true; } + { bDirectoryExists = true; } if (!bDirectoryExists && File.Exists(path)) - { bFileExists = true; } + { bFileExists = true; } //if the directory exists pop it open. if (bDirectoryExists) @@ -165,8 +173,8 @@ namespace LocalExplorer } private static void WriteOutputFile(string debugLine) { - // comment this out to debug the program - return; + if (!Properties.Settings.Default.DEBUG) + { return; } StreamWriter outFile = new StreamWriter(@"C:\LocalExplorer\OUTPUT.txt", true); outFile.WriteLine(debugLine);