How to overcome error - Control cannot fall through one case label to another in a switch?

I'm trying to make a switch based on a folder path selected and if its 1.) blank - then warn the user if its not blank check to see if they selected a root folder 2.) I:\proj - warn that its too large.  I also want to add another root folder 3.) G:\pj where it would warn that is also too large!

The highlight is on case case (@"I:\proj"):

How may I rewrite the following to account for that and not get the error and include the other G:\pj folder?  I'm new to C# sharp so please be patient with me.  Thank you in advance!
string sPath;
            sPath = txtPath.Text;

            switch (sPath)
            {
                case "":
            
                MessageBox.Show("You have not selected a folder.  Please click 'Browse' to continue.");
                break;

                case (@"I:\proj"):
                MessageBox.Show("Folder too large to search.");

            }

Open in new window

LVL 1
stephenlecomptejrAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SriVaddadiCommented:
case @"I:\proj":
                MessageBox.Show("Folder too large to search."); break

0
SriVaddadiCommented:
case @"I:\proj":
                MessageBox.Show("Folder too large to search."); break;
0
stephenlecomptejrAuthor Commented:
Ok so that worked for me but how about other folders besides I:\proj?
Do I have to do?

case @"I:\data":
                MessageBox.Show("Folder too large to search."); break;

case @"G:\pj":
                MessageBox.Show("Folder too large to search."); break;

case @"I:\proj":
                MessageBox.Show("Folder too large to search."); break;

Can't I do something like:

case @"I:\proj", @"I:\data", @"G:\pj":
                MessageBox.Show("Folder too large to search."); break;

When I try I get invalid expression term ',' syntax error expected ':'
0
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

SriVaddadiCommented:
What are the other cases? if you have covered all other cases you can use

            default:
                MessageBox.Show("Folder too large to search."); break;    
0
SriVaddadiCommented:
You can even say

case @"I:\proj":
            case @"I:\data":
            case @"G:\pj":
                MessageBox.Show("Folder too large to search."); break;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
stephenlecomptejrAuthor Commented:
Thank you greatly!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.