folder and file difference
-
how to identify whether a dropped object in my application is a file or a folder. atpresent, i am using File.Exists method and Directory.Exists. Is thr any other way to find out. Actually if we rightclick a file or folder and select properties... it will tell us whether it is a file or folder(Type: FileFOlder or File) any ways to retrive tht information. I am using C# application.
-
how to identify whether a dropped object in my application is a file or a folder. atpresent, i am using File.Exists method and Directory.Exists. Is thr any other way to find out. Actually if we rightclick a file or folder and select properties... it will tell us whether it is a file or folder(Type: FileFOlder or File) any ways to retrive tht information. I am using C# application.
this depends on the input you get. where do you retrieve the file/folder list from and how does it structure look like? If you can not make a difference between files and folders in the input you will have to do it as you currently do. So please tell me how your input (of files/folders) looks like.
-
how to identify whether a dropped object in my application is a file or a folder. atpresent, i am using File.Exists method and Directory.Exists. Is thr any other way to find out. Actually if we rightclick a file or folder and select properties... it will tell us whether it is a file or folder(Type: FileFOlder or File) any ways to retrive tht information. I am using C# application.
I assume you receive the path of the dropped object. If so you could do the following:
bool isDirectory = ((File.GetAttributes(path) & FileAttributes.Directory) == FileAttributes.Directory);
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
I assume you receive the path of the dropped object. If so you could do the following:
bool isDirectory = ((File.GetAttributes(path) & FileAttributes.Directory) == FileAttributes.Directory);
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
Thank u both for guiding me.