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("<", "<");
the = the.Replace(" ", " ");
the = the.Replace("\"", """);
the = the.Replace("\'", "'");
the = the.Replace("\n", "<br/> ");
return the;
}
通过在 Page 指令或 配置节中设置 validateRequest=false
就是在页面中加入
<%@page validateRequest=false %>
相关文档:
法一:调用winrar
using Microsoft.Win32;
using System.Diagnostics;
protected void Button1_Click(object sender, EventArgs e)
{
RAR(@"E:\95413594531\GIS", "tmptest", @"E:\95413594531\");
}
/// ......
Label——height:高度
width:宽度
backcolor:背景色
......
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 ......
一、性能参数:
1、 吞吐量
2、 响应时间
3、 执行时间
4、 可伸缩性
二、性能因素:
1、ASPX执行环境
2、编写代码逻辑
三、提高性能的方法:
1、 避免不必要的操作.例如:在Page_Load中使用IsPostBack;
2、 尽量减少使用服务器端控件
3、 关闭不必要 ......
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  ......