44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Reflection;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using System.Windows.Forms;
|
|||
|
|
|||
|
namespace RySmartEditor
|
|||
|
{
|
|||
|
internal static class Program
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 应用程序的主入口点。
|
|||
|
/// </summary>
|
|||
|
[STAThread]
|
|||
|
static void Main(string[] args)
|
|||
|
{
|
|||
|
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
|
|||
|
Application.EnableVisualStyles();
|
|||
|
Application.SetCompatibleTextRenderingDefault(false);
|
|||
|
Init.Show(args);
|
|||
|
}
|
|||
|
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
AssemblyName assemblyName = new AssemblyName(args.Name);
|
|||
|
if (System.IO.File.Exists(Application.StartupPath + @"\Bin\dlls\" + assemblyName.Name + ".dll"))
|
|||
|
{
|
|||
|
return Assembly.LoadFrom(Application.StartupPath + @"\Bin\dlls\" + assemblyName.Name + ".dll");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return args.RequestingAssembly;
|
|||
|
}
|
|||
|
}
|
|||
|
catch
|
|||
|
{
|
|||
|
return args.RequestingAssembly;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|