Capture console exit C#

I am not sure where I found the code on the web, but I found it now in one of my old projects. This will allow you to do cleanup code in your console, e.g. when it is abruptly closed or due to a shutdown… [DllImport(“Kernel32”)] private static extern bool SetConsoleCtrlHandler(EventHandler handler, bool add); private … Read more

WPF Command Line

First, find this attribute at the top of your App.xaml file and remove it: StartupUri=”Window1.xaml” That means that the application won’t automatically instantiate your main window and show it. Next, override the OnStartup method in your App class to perform the logic: protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); if ( /* test command-line params … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)