比如我如何一点按钮,就得到一个指定的aspx文件的源代码
就像我们通过 查看--源文件 得到的代码一样,实际就是html的代码
解决方案 »
- 急盼解答:搜索网站的内容全部是我的,而域名却不是了,为什么?
- 急急急!!!!站点和上传上来的文件放两个盘,c和d,读取是如何不显示绝对路径
- 现在还没吃,就是为了这个问题,解决了才去吃饭
- 关于customErrors 的配置
- 我添加了一个web按钮,click事件中执行 ListBox1.Items.Clear(); 为什么无效?
- 高手请进:内嵌“水晶报表”的参数字段。Asp.Net(c#)
- asp.net下有下拉式日历吗?如没有那里有下载这样控件的!
- 1.1下使用CompareValidator对Date进行验证为什么验证通过后,错误提示还在?
- 如何在一个.asp文件和一个.aspx文件之间传递Session参数?
- 想调试按钮按下后执行的代码(vb.net),设了断点(f9)后,程序跟不进去,语句已变为暗红色。vb.net中断点究竟如何设置?
- 这样可能实现吗?
- 无法找到脚本库
<%@ Import Namespace="System.IO" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="author" content="[email protected]">
<meta name="keywords" content="wei6, wei6.com, 威流, 威流网, 威流下载, 威流论坛">
<title>WEi6.COM</title>
<style>
body, input {
font-family: Fixedsys;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="directory" Text="c:\windows" runat="server" />
<asp:Button ID="Button1" Text="查看目录里的文件" OnClick="btn1_click" runat="server" />
</form>
<asp:Label ID="msg" runat="server" />
<center><hr>Copyright ©2004 WEi6.COM</center>
</body>
</html>
<script language="c#" runat="server">
private void Page_Load(object sender, EventArgs e){
if(Request["module"]=="dis"){
string file_name=Request["file_name"];
StreamReader sr=File.OpenText(file_name);
string content=sr.ReadToEnd();
msg.Text=Server.HtmlEncode(content).Replace("\r\n", "<br>");
}
}private void btn1_click(object sender, System.EventArgs e){
string[] strings=System.IO.Directory.GetFiles(directory.Text);
for(int i=0;i<strings.Length;i++){
msg.Text+="<a href='?module=dis&file_name="+strings[i]+"'>"+strings[i]+"</a><br>";
}
}
</script>
孟老大的