As shown below:
if((path)){ // It's a file}else if((path)){ // It's a folder}else{ // None}
The example of whether you are getting a folder or a file in the above article C# is all the content I have shared with you. I hope you can give you a reference and I hope you can support me more.