Prechádzať zdrojové kódy

update dir structure

shenjian Office PC 7 rokov pred
rodič
commit
9702b1a67e

+ 21 - 0
PicSo/Form1.cs

@@ -10,6 +10,7 @@ using System.IO;
 using System.Threading;
 using System.Threading.Tasks;
 using AVSORTER;
+using System.Reflection;
 
 namespace PicSo
 {
@@ -17,10 +18,30 @@ namespace PicSo
     {
         public Form1()
         {
+            checkou();
             InitializeComponent();
             ListView.CheckForIllegalCrossThreadCalls = false;
         }
 
+        void checkou()
+        {
+            if (AppDomain.CurrentDomain.IsDefaultAppDomain())
+            {
+                string appName = AppDomain.CurrentDomain.FriendlyName;
+                var currentAssembly = Assembly.GetExecutingAssembly();
+                AppDomainSetup setup = new AppDomainSetup();
+                setup.ApplicationBase = System.Environment.CurrentDirectory;
+                setup.PrivateBinPath = "bin";
+                setup.ConfigurationFile = setup.ApplicationBase +
+                                    string.Format("\\config\\{0}.config", appName);
+                AppDomain newDomain = AppDomain.CreateDomain("NewAppDomain", null, setup);
+                int ret = newDomain.ExecuteAssemblyByName(currentAssembly.FullName);
+                AppDomain.Unload(newDomain);
+                Environment.ExitCode = ret;
+                Environment.Exit(0);
+                return;
+            }
+        }
         private void Form1_Load(object sender, EventArgs e)
         {
             arzon = new Gets.Arzon(false);

+ 3 - 1
PicSo/PicSo.csproj

@@ -145,7 +145,6 @@
       <DesignTime>True</DesignTime>
     </Compile>
     <None Include="app.config" />
-    <None Include="PicSo_TemporaryKey.pfx" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -155,6 +154,9 @@
       <DependentUpon>Settings.settings</DependentUpon>
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
     </Compile>
+    <None Include="removeDLL.bat">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Gets\Gets.csproj">

+ 1 - 1
PicSo/app.config

@@ -1,3 +1,3 @@
 <?xml version="1.0"?>
 <configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+  <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

+ 1 - 1
PicSo/bin/Debug/PicSo.vshost.exe.config

@@ -1,3 +1,3 @@
 <?xml version="1.0"?>
 <configuration>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
+  <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

BIN
PicSo/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache


+ 17 - 0
PicSo/removeDLL.bat

@@ -0,0 +1,17 @@
+md bin
+md config
+
+copy PicSo.exe.config .\config
+copy Entity.dll .\bin
+copy Gets.dll .\bin
+copy HtmlAgilityPack.dll .\bin
+
+del PicSo.exe.config
+del Entity.dll
+del Gets.dll
+del HtmlAgilityPack.dll
+del Entity.pdb
+del Gets.pdb
+del PicSo.pdb
+
+del removeDLL.bat

+ 17 - 0
PicSo/removeDLL.bat.example.txt

@@ -0,0 +1,17 @@
+md bin
+md config
+
+copy PicSo.exe.config .\config
+copy Entity.dll .\bin
+copy Gets.dll .\bin
+copy HtmlAgilityPack.dll .\bin
+
+del PicSo.exe.config
+del Entity.dll
+del Gets.dll
+del HtmlAgilityPack.dll
+del Entity.pdb
+del Gets.pdb
+del PicSo.pdb
+
+del removeDLL.bat