I have seen ArticleThe fileinfo and directoryinfo classes are mainly used for file and directory attributes. They do not have good operation functions on the cloud and seem to be suspected of being missing the meaning of the document.
Also talk about your learning experience:
1. file and directory provide static methods; fileinfo and directoryinfo provide instance methods.
If you only use the file once, the efficiency of file and directory is high. If you use the object multiple times, we recommend that you use fileinfo and directoryinfo to avoid the security check of file and directory.
What is the security check here? I still don't know. Please kindly advise.
2. The usage is different for the above reasons.
File and directory methods can be used directly without creating an instance.
For example, delete an object:
File. Delete (
Strfilename)
That's all. It's very convenient.
If you want to use fileinfo, You need:
Dim F as fileinfo = new fileinfo (
Strfilename)
F. Delete ()
'Create again
F. Create ()
'Delete again
F. Delete () is basically the difference. Let's take a look at the two methods. There should be no difference. But why is the class name *** info.