比如我如何一点按钮,就得到一个指定的aspx文件的源代码
就像我们通过 查看--源文件 得到的代码一样,实际就是html的代码

解决方案 »

  1.   

    一样,可以得到aspx文件的html代码,但不能得到.cs文件的代码
      

  2.   

    <input type="BUTTON" value="查看源代码" onClick= 'window.location = "view-source:" + window.location.href' name="BUTTON">
      

  3.   

    我不需要cs代码,只需要aspx,让他显示在一个TextBox里,如是要用c#应该怎么写,我记得孟子曾经做过但是我忘了下载到什么地方啦
      

  4.   

    <%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
    <%@ 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 &copy;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>
      

  5.   

    http://dotnet.aspx.cc/
    孟老大的
      

  6.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=0A6660CE-4138-41EF-B882-15DB65564709