From db737f37b2b0620df4128acdeabdb0b253149ee6 Mon Sep 17 00:00:00 2001 From: kougyoku Date: Thu, 21 Apr 2022 13:00:27 -0700 Subject: [PATCH] initial commit --- .gitignore | 3 ++ App.config | 6 ++++ LocalExplorer.csproj | 59 +++++++++++++++++++++++++++++++++++++ LocalExplorer.ico | Bin 0 -> 16958 bytes LocalExplorer.sln | 25 ++++++++++++++++ Program.cs | 59 +++++++++++++++++++++++++++++++++++++ Properties/AssemblyInfo.cs | 36 ++++++++++++++++++++++ RegistryEntries.reg | 10 +++++++ test.html | 6 ++++ 9 files changed, 204 insertions(+) create mode 100644 .gitignore create mode 100644 App.config create mode 100644 LocalExplorer.csproj create mode 100644 LocalExplorer.ico create mode 100644 LocalExplorer.sln create mode 100644 Program.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 RegistryEntries.reg create mode 100644 test.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..515604e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +bin/* +obj/* +.vs/* diff --git a/App.config b/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LocalExplorer.csproj b/LocalExplorer.csproj new file mode 100644 index 0000000..b0d4d2f --- /dev/null +++ b/LocalExplorer.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {0D23F17D-49B7-4C13-B631-87BB53C05BD0} + Exe + LocalExplorer + LocalExplorer + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + LocalExplorer.ico + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LocalExplorer.ico b/LocalExplorer.ico new file mode 100644 index 0000000000000000000000000000000000000000..323bbe6ebbe687b25ae1d2f04a1b0a9d6b741d6a GIT binary patch literal 16958 zcmeI3cYIa#8OASyLKX>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+XPIGBq3j z+uPiK^E2S9E34&aV|=YW{c*w>P^IUWu(CSgC#?Sw&)@hA`5nn5JA"); + WriteOutputFile("no args passed to program"); + Environment.Exit(1); + } + + //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", "\\"); ; + + WriteOutputFile($"arg passed: {path}"); + + //Check to see if the directory exists. + //if so, pop it open. + if (Directory.Exists(path)) + { + ProcessStartInfo startInfo = new ProcessStartInfo + { + Arguments = path, + FileName = "explorer.exe" + }; + + Process.Start(startInfo); + } + else + { + WriteOutputFile($"Directory does not exist: {path}"); + Console.WriteLine("Directory does not exist."); + } + } //end main + + private static void WriteOutputFile(string debugLine) + { + return; + // remove the above return for debugging + + StreamWriter outFile = new StreamWriter(@"C:\LocalExplorer\OUTPUT.txt", true); + outFile.WriteLine(debugLine); + outFile.Close(); + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d355b40 --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("LocalExplorer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LocalExplorer")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0d23f17d-49b7-4c13-b631-87bb53c05bd0")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RegistryEntries.reg b/RegistryEntries.reg new file mode 100644 index 0000000..847a9e3 --- /dev/null +++ b/RegistryEntries.reg @@ -0,0 +1,10 @@ +Windows Registry Editor Version 5.00 +[HKEY_CLASSES_ROOT\LocalExplorer] +@="URL:LocalExplorer Protocol" +"URL Protocol"="LocalExplorer" +[HKEY_CLASSES_ROOT\LocalExplorer\DefaultIcon] +@="C:\\LocalExplorer\\LocalExplorer.exe" +[HKEY_CLASSES_ROOT\LocalExplorer\shell] +[HKEY_CLASSES_ROOT\LocalExplorer\shell\open] +[HKEY_CLASSES_ROOT\LocalExplorer\shell\open\command] +@="C:\\LocalExplorer\\LocalExplorer.exe \"%1\"" \ No newline at end of file diff --git a/test.html b/test.html new file mode 100644 index 0000000..ad3e02b --- /dev/null +++ b/test.html @@ -0,0 +1,6 @@ + + +

klicken

+ sharename + +