Update Program.cs
Replace / with \ to support unc on links that require / If URL contains #, strip it out. Add runtime configurable DEBUG property
This commit is contained in:
parent
c40cefb363
commit
f10c14253c
12
Program.cs
12
Program.cs
@ -49,6 +49,14 @@ namespace LocalExplorer
|
|||||||
//protocol handler, replace it with an actual space.
|
//protocol handler, replace it with an actual space.
|
||||||
path = path.Replace("%20", " ");
|
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}");
|
WriteOutputFile($"arg passed: {path}");
|
||||||
|
|
||||||
//Determine if file or directory.
|
//Determine if file or directory.
|
||||||
@ -165,8 +173,8 @@ namespace LocalExplorer
|
|||||||
}
|
}
|
||||||
private static void WriteOutputFile(string debugLine)
|
private static void WriteOutputFile(string debugLine)
|
||||||
{
|
{
|
||||||
// comment this out to debug the program
|
if (!Properties.Settings.Default.DEBUG)
|
||||||
return;
|
{ return; }
|
||||||
|
|
||||||
StreamWriter outFile = new StreamWriter(@"C:\LocalExplorer\OUTPUT.txt", true);
|
StreamWriter outFile = new StreamWriter(@"C:\LocalExplorer\OUTPUT.txt", true);
|
||||||
outFile.WriteLine(debugLine);
|
outFile.WriteLine(debugLine);
|
||||||
|
Loading…
Reference in New Issue
Block a user