c# SplashScreen Assembly Loaded 确实有效

c# SplashScreen Assembly Loaded does work

我想显示我的应用程序程序集在启动时首先加载 申请。

应用程序启动后 运行,我的代码没有显示任何内容。

public Form1()
{
    InitializeComponent();

    AppDomain.CurrentDomain.AssemblyLoad += new    
    AssemblyLoadEventHandler(CurrentDomain_AssemblyLoad);
}


void CurrentDomain_AssemblyLoad(object sender, AssemblyLoadEventArgs args)
{
   Debug.WriteLine("Loaded " + args.LoadedAssembly.FullName);
   label1.Text = "Loaded " + args.LoadedAssembly.FullName;

   Thread.Sleep(500);
}

问题出在哪里?

您应该在 Main(); 中调用它 当表单显示时,所有程序集都已加载,请参阅 https://msdn.microsoft.com/pl-pl/library/system.appdomain.assemblyload(v=vs.110).aspx