Programming Tutorial On The Way

free online programming resource on dotnet, csharp, web related topics

Renaming a File

With all of the bells and whistles hanging off of the .NET Framework, you would figure that renaming a file is easy. Unfortunately, there is no specific rename method that can be used to rename a file. Instead, you can use the static Move method of the File class or the instance MoveTo method of the FileInfo class. The static File.Move method can be used to rename a file in the following manner: Read the rest of this entry »

Popularity: 1% [?]

Renaming a Directory

There is no specific method for renaming a directory/folder in .NET Framework class library. However, you can use the instance MoveTo method of the DirectoryInfo class or the static Move method of the Directory class instead. The static Move method can be used to rename a directory in the following manner:
Read the rest of this entry »

Popularity: 1% [?]

When reading a file, you sometimes need to move from the current position in a file to a position some number of characters before or after the current position, including to the beginning or the end of a file. After moving to this point, you can add, modify, or read the information at this new point in the file. Read the rest of this entry »

Popularity: 4% [?]

.NET Framework written application is able to run on different platform. Each platform uses a different end-of-line (EOL) character. You want your code to output the correct EOL character without having to write code to handle the EOL character specially for each platform. Read the rest of this entry »

Popularity: 1% [?]

.NET Framework written application is able to run on different platform. Each platform uses a different end-of-line (EOL) character. You want your code to output the correct EOL character without having to write code to handle the EOL character specially for each platform. Read the rest of this entry »

Popularity: 2% [?]

Manipulating File Attributes

To display a file’s timestamps, you can use either the static methods of the File class or the instance properties of the FileInfo class. The static methods are GetCreationTime, GetLastAccessTime, and GetLastWriteTime. Each has a single parameter, the path and name of the file whose timestamp information is to be returned, and returns a DateTime value containing the relevant timestamp. For example: Read the rest of this entry »

Popularity: 2% [?]

To display a directory’s timestamps, you can use either the static methods of the Directory class or the instance properties of the DirectoryInfo class. The static methods are GetCreationTime, GetLastAccessTime, and GetLastWriteTime. Each has a single parameter, the path to the directory whose timestamp information is to be returned, and returns a DateTime value containing the relevant timestamp. For example: Read the rest of this entry »

Popularity: 2% [?]

To determine whether a file exists prior to creating or performing an action on that file, you can use the static Exists method of the File class. Read the rest of this entry »

Popularity: 1% [?]

« Previous Entries  Next Entries »