FileWebResponse.ResponseUri Property
.NET Framework 4.5
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 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.