易截截图软件、单文件、免安装、纯绿色、仅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 标准控件 (一)

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

将Asp.net页面输出为HTML

WebRequest mywebrq;
WebResponse mywebresp;
StreamReader sr;
Streamwriter sw;
Private void Page_Load(object sender,EventArgs e) { mywebreq=WebRequest.Create( http://localhost/Test.aspx ); mywebresp=mywebreq.GetResponse();
sr=new streamReader(mywebresp.GetResponsestream());
strHtml=sr.ReadT ......

提高ASP.NET性能的方法

 
 一、性能参数:
  1、 吞吐量
  2、 响应时间
  3、 执行时间
  4、 可伸缩性
  二、性能因素:
  1、ASPX执行环境
  2、编写代码逻辑
  三、提高性能的方法:
  1、 避免不必要的操作.例如:在Page_Load中使用IsPostBack;
  2、 尽量减少使用服务器端控件
  3、 关闭不必要 ......

C#发送邮件代码 (B/S、C/S皆可用)

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号