易截截图软件、单文件、免安装、纯绿色、仅160KB

C# ASP.NET 获取脚本语句并用文本的方式显示出来

protected void Button6_Click(object sender, EventArgs e)
    {
        this.Label11.Text = HtmlEncode(this.TextBox3.Text);
 
       
    }
    protected static string HtmlEncode(string the)
    {
   
        the = the.Replace("<", "&lt;");
        the = the.Replace(" ", "&nbsp;");
        the = the.Replace("\"", "&quot;");
        the = the.Replace("\'", "'");
        the = the.Replace("\n", "<br/> ");
        return the;
    }
通过在 Page 指令或 配置节中设置 validateRequest=false
就是在页面中加入
<%@page validateRequest=false %>


相关文档:

asp.net文件和文件夹压缩

法一:调用winrar
using Microsoft.Win32;
using System.Diagnostics;
protected void Button1_Click(object sender, EventArgs e)
    {
        RAR(@"E:\95413594531\GIS", "tmptest", @"E:\95413594531\");
    }
    /// ......

ASP.NET在本地服务器上创建目录并在该目录下写文件

public static Boolean WriteTextFile(string content, string filepath,string name)
{
FileStream fs;
StreamWriter sw;
if (!System.IO.Directory.Exists(filepath))
{
DirectoryInfo DirInfo = Directory.CreateDirectory(filepath); //创建目录
DirI ......

Asp.net 标准控件 (一)

Label——height:高度
              width:宽度
              backcolor:背景色
             ......

asp.net窗体的打开和关闭

asp.net窗体的打开和关闭
//打开新的窗体
Response.Redirect("WebMain.aspx");   
//弹出一个新窗体
Response.Write("<script>window.open(\"WebMain.aspx\")</script>")
//弹出一个只有确定按钮的提示框
Response.Write("<script>alert(\"用户名或密码错误\");</script>") ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号