BlackWasp
Console Applications and ColourConsole Applications and Colour
Console applications are useful for simple applications and tools, particularly where complex user interfaces are not required. However, plain white on black text can be difficult to read quickly. Using colour in console applications can improve output.
Detecting File Changes with FileSystemWatcherDetecting File Changes with FileSystemWatcher
If you are developing a Windows Explorer-style application or integrating with a legacy or third-party system that can only provide information via files, you may need to monitor the files within a folder. The FileSystemWatcher class permits this.
Identifying System FoldersIdentifying System Folders
The Microsoft Windows environment includes many special folders, such as the folders for the desktop, music and pictures as well as the program files and system directories. These folders do not have fixed paths so they must be accessed correctly.
Getting and Setting a Program's Working FolderGetting and Setting a Program's Working Folder
When a program is executed a working folder is assigned. This may be the same folder as the program's executable or can be set to a different folder using the properties of a shortcut. The correct working folder can be found using the Environment class.
Checking that a Folder ExistsChecking that a Folder Exists
A common verification test to be carried out is checking that a specified folder, or directory, exists. This test process can be easily undertaken using the static methods of the Directory class, which is provided within the .NET framework.
Checking that a File ExistsChecking that a File Exists
A common verification test to be carried out is checking that a specified file exists. This test process can be easily undertaken using the static methods of the File class, which is provided within the .NET framework.
Building a File Path with Path.CombineBuilding a File Path with Path.Combine
When using a variety of input methods to accept a file path and file name, the format of the results can vary. To avoid the problems of checking for path separator characters and adding or removing them as required, .NET provides a method to provide this.
RSS RSS Feed
74 users on-line