Przeglądaj źródła

增加 加载dll的辅助类,方便动态加载dll

tanghai 13 lat temu
rodzic
commit
ced56c5749

+ 1 - 0
CSharp/Platform/Helper/Helper.csproj

@@ -35,6 +35,7 @@
     <Reference Include="System.Xml" />
     <Reference Include="System.Xml" />
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
+    <Compile Include="LoaderHelper.cs" />
     <Compile Include="XmlHelper.cs" />
     <Compile Include="XmlHelper.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
   </ItemGroup>

+ 17 - 0
CSharp/Platform/Helper/LoaderHelper.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Reflection;
+
+namespace Helper
+{
+	public static class LoaderHelper
+	{
+		public static Assembly Load(string path)
+		{
+			byte[] buffer = File.ReadAllBytes(path);
+			var assembly = Assembly.Load(buffer);
+			return assembly;
+		}
+	}
+}

+ 1 - 1
CSharp/Platform/Helper/XmlHelper.cs

@@ -6,7 +6,7 @@ using System.Xml.Serialization;
 
 
 namespace Helper
 namespace Helper
 {
 {
-    public class XmlHelper
+    public static class XmlHelper
     {
     {
 		/// <summary>
 		/// <summary>
 		/// 对象序列化成 XML String
 		/// 对象序列化成 XML String