FileWebResponse.ResponseUri Property
.NET Framework 4
Gets the URI of the file system resource that provided the response.
Assembly: System (in System.dll)
The following example uses the ResponseUri to retrieve the URI of the file system resource that provided the response.
Public Shared Sub GetPage(ByVal url As [String]) Try Dim fileUrl As New Uri("file://" + url) ' Create a 'FileWebrequest' object with the specified Uri. Dim myFileWebRequest As FileWebRequest = CType(WebRequest.Create(fileUrl), FileWebRequest) ' Send the 'fileWebRequest' and wait for response. Dim myFileWebResponse As FileWebResponse = CType(myFileWebRequest.GetResponse(), FileWebResponse) Console.WriteLine("The Uri of the file system resource that provided the response is : {0}", myFileWebResponse.ResponseUri) myFileWebResponse.Close() Catch e As WebException Console.WriteLine(ControlChars.Lf + ControlChars.Cr + "The Reason for failure is : {0}", e.Status) Catch e As Exception Console.WriteLine(ControlChars.Cr + "The following exception was raised : {0}", e.Message) End Try
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.