File, fileinfo; directory, directoyinfo

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.