Click here to Skip to main content
15,890,388 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I am working on a .NET winform app. Once the application starts I display a splash page. While the splash page is displayed I run through a series of actions. For instance: I want to make sure they are connected to the internet, make sure they are dialed into the company VPN, make sure specific files exist on their laptop, etc. If everything is ok, I want to move to the login screen. If not, I want to go to an error screen which will describe the issues.

My question: what is the best way to handle the entire process above? I would assume that multi-threading would be a good strategy to separate the background actions from the splash ui. Maybe use a threadpool? Should I possible use a timer too... so I can trigger an error if one of the actions gets hung-up? Just looking for some best practices...
Posted

You can display consecutive forms, allowing each one to live as long as it's needed and then close itself. I wrote a tip/trick about it:

Multiple Subsequent "Main" Forms in C# Apps[^]
 
Share this answer
 
A BackgroundWorker[^] would be the thing to use IMO
 
Share this answer
 
Comments
Dr.Walt Fair, PE 10-Dec-10 18:57pm    
That's how I would do it, but JSOP's method below is a little more elegant.
All of the practices you described are most recommended. Also provide status or indication in your spalsh screen that something is going on.
 
Share this answer
 
Comments
atlquaker 10-Dec-10 14:30pm    
Good idea. What is the best way to pass each status update to the splash screen?
HimanshuJoshi 10-Dec-10 14:56pm    
The BackGroundWorker in Mark Nischalke's answer is best for this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900