ASP.Net/Request/Path — различия между версиями

Материал из .Net Framework эксперт
Перейти к: навигация, поиск
м (1 версия)
 
(нет различий)

Версия 15:30, 26 мая 2010

Displaying additional path information in ASP.NET

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Displaying additional path information in ASP.NET</title>
   </head>
<body>
<p>
<%
   Response.Write("File Path = " & Request.FilePath & "<br>")
   Response.Write("Path = " & Request.Path & "<br>")
   Response.Write("Additional Path Info = " & Request.PathInfo & "<br>")
   Response.Write("Physical Application Path = " & Request.PhysicalApplicationPath & "<br>")
   Response.Write("Physical Path = " & Request.PhysicalPath)
%>
</p>
</body>
</html>



Displaying the Request.FilePath property in ASP.NET

<%@ Page Language="vb" %>
<html>
   <head>
      <title>Displaying the Request.FilePath property in ASP.NET</title>
   </head>
<body>
<p>
<%
   Dim fp As String
   fp = Request.FilePath
   Response.Write("The virtual path of the current request is: <strong>" & fp & "</strong>")
%>
</p>
</body>
</html>



Request.PhysicalApplicationPath (C#)

<%@ Page Language="c#" %>
<html>
  <body>
    <H2>Response.WriteFile()</H2>
    <%;
    
    Response.Write(Request.PhysicalApplicationPath);
    %>
  </body>
</html>