📄 default.aspx
字号:
<%@Page Language="C#" %>
<%@Import Namespace="System.IO" %>
<%@Import Namespace="System.Net" %>
<script runat="server">
void Page_Load() {
// ******** Remember to edit next line to match location of this file ********
// ******** ASPNET account must have write permission for this folder ********
String sOriginalFile = "http://localhost/7868-cs/static-pages/input-page.aspx";
String sDiskFile = "result.htm";
// create a Web Request object with a specified virtual path
WebRequest oWRequ = WebRequest.Create(sOriginalFile);
// send the request and collect the response in a Stream object
WebResponse oWResp = oWRequ.GetResponse();
Stream oStream = oWResp.GetResponseStream();
// create a StreamReader to read the stream
StreamReader oReader = new StreamReader(oStream, Encoding.ASCII);
// create a StreamWriter and use it to write the stream to a disk file
StreamWriter oWriter = new StreamWriter(Server.MapPath(sDiskFile));
oWriter.Write(oReader.ReadToEnd());
// close all the objects
oWriter.Close();
oReader.Close();
oWResp.Close();
// display confirmation that it worked
lblOutput.Text = sOriginalFile;
aLink.Text = sDiskFile;
aLink.NavigateUrl = sDiskFile;
}
//-----------------------------------------
</script>
<html>
<body>
<font face="Arial,sans-serif" size="2"><b>
Used the file:
<asp:Label id="lblOutput" runat="server" />
<br />to generate the file:
<asp:Hyperlink id="aLink" runat="server" />
</b></font>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -