You can use SocketErrorCode property of the SocketException class to determine the type of error.
Use the System.Net.Sockets.SocketErrorCode Enumeration,
e.g.
ex.SocketErrorCode = System.Net.Sockets.SocketError.ConnectionRefused;
I'd look at Windows Management Instrumentation (WMI) if I were you.
This guy uses various windows development kits to achieve what you want,
http://www.codeproject.com/csharp/usbeject.asp
though I think WMI might be a better approach if you've got time to figure it out.
Can't you just use a ServiceInstaller to do all this? It will auto-install/un-install your service after you run the msi in a setup project.
http://msdn2.microsoft.com/en-us/library/system.serviceprocess.serviceinstaller.aspx
Use ShowDialog(IWin32Window Owner)
i.e. cd1.ShowDialog(this);
This will make your main force the parent of the dialog window and will therefore push the parent form behind the dialog.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.