From 16c9c8f9b47435d6cab757eaa8ea9c3e8181f1ef Mon Sep 17 00:00:00 2001 From: kougyoku Date: Mon, 9 May 2022 11:10:46 -0700 Subject: [PATCH] Update Program.cs Update so program can handle path with spaces in it. Update location of debugging output data to a spot where a user most likely has access to write. --- Program.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 1cf5e8c..0855f36 100644 --- a/Program.cs +++ b/Program.cs @@ -34,7 +34,11 @@ namespace LocalExplorer //Collect up the path //the replace function is here to trim out the arg as it //comes in from the url protocol handler - string path = args[0].Replace("localexplorer:", "").Replace("%5C", "\\"); ; + string path = args[0].Replace("localexplorer:", "").Replace("%5C", "\\"); + + //If there is a space in the path as it comes from the URL + //protocol handler, replace it with an actual space. + path = path.Replace("%20", " "); WriteOutputFile($"arg passed: {path}"); @@ -72,7 +76,7 @@ namespace LocalExplorer // comment this out to debug the program return; - StreamWriter outFile = new StreamWriter(@"C:\Windows\ISD\OUTPUT.txt", true); + StreamWriter outFile = new StreamWriter(@"C:\LocalExplorer\OUTPUT.txt", true); outFile.WriteLine(debugLine); outFile.Close(); }