viewsource.aspx

来自「Professional ASP.NET source code」· ASPX 代码 · 共 46 行

ASPX
46
字号
<%@ Page Language="C#" %>
<%@ Import Namespace="System.IO" %>

<%
	string strFilePath;
	string strNameOnly;
	string strContent;
	int intFind;
	Uri address = new Uri(Request.UrlReferrer.ToString(), true);
	strFilePath = Server.MapPath(address.LocalPath);
	strNameOnly = strFilePath.Substring(strFilePath.LastIndexOf("\\") + 1);
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><% = strFilePath %></title>
<style type="text/css">
body {font-family:Tahoma,Arial,sans-serif; font-size:10pt}
input {font-family:Tahoma,Arial,sans-serif; font-size:9pt}
.heading {font-family:Tahoma,Arial,sans-serif; font-size:14pt; font-weight:bold}
.subhead {font-family:Tahoma,Arial,sans-serif; font-size:12pt; font-weight:bold; padding-bottom:5px}
.cite {font-family:Tahoma,Arial,sans-serif; font-size:8pt}
</style>
</head>
<body bgcolor="#ffffff">
<span class="heading"><% = strFilePath %></span><hr />
<!--------------------------------------------------------------------------->

<XMP>
<%
	if (strFilePath != "")
	{
		StreamReader objSR = File.OpenText(strFilePath);
		Response.Write(objSR.ReadToEnd());
		objSR.Close();
	}
%>
</XMP>

<!--------------------------------------------------------------------------->
<hr /><span class="cite">&copy;2001 <a class="cite" href="http://www.wrox.com/">Wrox Press</a> -
<a class="cite" href="http://www.wrox.com/Books/Book_Details.asp?isbn=1861004885">Professional ASP.NET</a> (ISBN: 1-861004-88-5)</span>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?