Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Build Your Own ASP.NET 2.0 Web Site Using CSharp And VB (2006) [eng]-1.pdf
Скачиваний:
142
Добавлен:
16.08.2013
Размер:
15.69 Mб
Скачать

14 Working with Files and Email

The .NET Framework exposes a set of classes for working with text files, drives, and directories, through the System.IO namespace. This namespace exposes functionality that allows you to read from, write to, and update content within, directories and text files. On occasion, you will want to read from and write to a text file. Text files almost always use a format that’s based on the ASCII standard, which is perhaps the most widely accepted cross-platform file format, and has been around since the 1960s. This makes it a very useful way of exchanging information between programs—even if they’re running on different platforms and operating systems.

As we’ll see in the course of this chapter, we can use the set of classes exposed by the System.IO namespace to complete the following tasks:

write to text files

The sales department within our fictitious company may want to write sales and forecast information to a text file.

read from text files

As a member of the web development team, you may want to use the data within a text file to create dynamic graphs to display sales and revenue forecasts on the Web.