C # obtain the file size, creation time, file information, and attributes of the fileinfo class. Table 09:00:40 | category: C # | report | font size subscription openfiledialog1 = new openfiledig1 (); if (openfiledialog1.showdialog () = dialogresult.
Directoryinfo and fileinfo are directory and file functions. In addition, they make it easier to traverse the relationship between files and directories. For example, you can easily obtain the fileinfo object of files in the directory represented by
File and folder operations-File, Directory, FileInfo, DirectoryInfo, and cfilefileinfo
File and folder operations:
C/S: WinForm can operate the Client file Client ServerB/S: Brower Server
Namespace: using system. IO;
1. File class:
Create: File.
(FileStream, StreamWriter, StreamReader, File, FileInfo, Directory, DirectoryInfo, Path, Encoding)C # files and streams (FileStream, StreamWriter, StreamReader, file, FileInfo, Di, you can refer to the required friends. Files and Streams (FileStream,
Unlike the file class, the FileInfo class does not have a static method and can be used only for instantiated pairs of images. FileInfo to files that are represented on a disk or network location, note that it is not a stream, and in order to read
To design the "Network hard disk" function, you must first familiarize yourself with the operations for processing files and folders in. net. File and directory are the two most important classes. Understanding them will greatly facilitate the
In C # provides the file and the FileInfo class, these two classes of methods are basically the same, previously only know to use, has not figured out what is the difference, reading today a little unexpected harvest, and partners to share:
Both
The base classes of the DirectoryInfo class and the FileInfo class are FileSystemInfo classes, which is an abstract class, that is, you cannot instantiate the class, but can only produce its subclasses through inheritance and instantiate its
Through the FileInfo class, we can easily create files, and can access the properties of the file can also open files, close files, read and write files and other basic operations. The following code shows how to create a text file and Access file
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.