Application Sub Main
I've created an .Net application. Now I wanted to include a application crashed - I am sorry开发者_Python百科 messagebox. But I cannot find any Sub Main()
routine or even if I create my new own module I am not able to selecte the Sub Main()
in the module as startobject.
Any advice?
Did you create a VB.NET application? If so, you'll need to add your own Sub Main()
. The disadvantage of this, however, is that you'll have to manually handle all of the startup processing and initialization that the .NET Framework normally does for you automatically.
But if all you want to do is show an error message when an unhandled exception occurs, there's no reason to create your own Sub Main()
. All you have to do is add a handler for the AppDomain.UnhandledException
event.
精彩评论