Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
FileWebResponse Class
Collapse the table of content
Expand the table of content

FileWebResponse Class

Provides a file system implementation of the WebResponse class.

Namespace:  System.Net
Assembly:  System (in System.dll)

public class FileWebResponse : WebResponse, 

The FileWebResponse type exposes the following members.

Protected methodFileWebResponse Obsolete. Initializes a new instance of the FileWebResponse class from the specified instances of the SerializationInfo and StreamingContext classes.

Public propertyContentLengthGets the length of the content in the file system resource. (Overrides WebResponse.ContentLength.)
Public propertyContentTypeGets the content type of the file system resource. (Overrides WebResponse.ContentType.)
Public propertyHeadersGets a collection of header name/value pairs associated with the response. (Overrides WebResponse.Headers.)
Public propertyIsFromCacheGets a Boolean value that indicates whether this response was obtained from the cache. (Inherited from WebResponse.)
Public propertyIsMutuallyAuthenticatedGets a Boolean value that indicates whether mutual authentication occurred. (Inherited from WebResponse.)
Public propertyResponseUriGets the URI of the file system resource that provided the response. (Overrides WebResponse.ResponseUri.)
Public propertySupportsHeadersGets a value that indicates whether the Headers property is supported by the FileWebResponse instance. (Overrides WebResponse.SupportsHeaders.)

Public methodCloseCloses the response stream. (Overrides WebResponse.Close().)
Public methodCreateObjRefCreates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public methodDispose()Releases the unmanaged resources used by the WebResponse object. (Inherited from WebResponse.)
Protected methodDispose(Boolean)Releases the unmanaged resources used by the WebResponse object, and optionally disposes of the managed resources. (Inherited from WebResponse.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetLifetimeServiceRetrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected methodGetObjectDataPopulates a SerializationInfo with the data needed to serialize the target object. (Overrides WebResponse.GetObjectData(SerializationInfo, StreamingContext).)
Public methodGetResponseStreamReturns the data stream from the file system resource. (Overrides WebResponse.GetResponseStream().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInitializeLifetimeServiceObtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Protected methodMemberwiseClone()Creates a shallow copy of the current Object. (Inherited from Object.)
Protected methodMemberwiseClone(Boolean)Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Explicit interface implemetationPrivate methodIDisposable.DisposeInfrastructure. When overridden in a derived class, releases all resources used by the WebResponse. (Inherited from WebResponse.)
Explicit interface implemetationPrivate methodISerializable.GetObjectDataInfrastructure. Populates a SerializationInfo instance with the data needed to serialize the FileWebResponse.

The FileWebResponse class implements the WebResponse abstract base class to return file system resources for the FileWebRequest class.

Client applications do not create FileWebResponse instances directly; instead, they are created by calling the GetResponse method on a FileWebRequest instance.

The GetResponseStream method returns a Stream instance that provides read-only access to a file system resource.

The FileWebResponse class relies on the File class for error handling and code access security.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft