VirtualFile::Open Method ()
When overridden in a derived class, returns a read-only stream to the virtual resource.
Assembly: System.Web (in System.Web.dll)
Notes to Inheritors:
In derived classes the NotSupportedException is thrown when the stream is passed to the HttpResponse object to write out the data. The exception occurs because the response tries to read the Length property, and on a stream that is not seekable, attempting to access the property causes an exception. For more information, see the CanSeek property.method must return a seekable stream. If the method returns a stream that does not support seeking, a
The following code example is an implementation of the VirtualFile class overview.method that combines virtual-file-specific information with a template file and then returns the combination. The template file is cached to reduce the overhead of reading the file system multiple times to retrieve the template file. For the full code required to run the example, see the Example section of the
Available since 2.0