Custom Stream Classes


Visual Studio provides a few other stream classes with more specialized uses.

The CryptoStream class applies a cryptographic transformation to data that passes through it. For example, if you attach a CryptoStream to a file using a particular cryptographic transformation and then use it to write data, the CryptoStream automatically transforms the data and produces an encrypted file. Similarly, you can use a CryptoStream to read an encrypted file and recover the original text.

The NetworkStream class represents a socket-based stream over a network connection. You can use this class to make different applications communicate over a network.

Three other special uses of streams are standard input, standard output, and standard error. Console applications define these streams for reading and writing information to and from the console. An application can interact directly with these streams by accessing the Console.In, Console.Out, and Console.Error properties. It can change these streams to new stream objects such as StreamReaders and StreamWriter by calling the Console.SetIn, Console.SetOut, and Console.SetError methods.




Visual Basic 2005 with  .NET 3.0 Programmer's Reference
Visual Basic 2005 with .NET 3.0 Programmer's Reference
ISBN: 470137053
EAN: N/A
Year: 2007
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net