易截截图软件、单文件、免安装、纯绿色、仅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在本地服务器上创建目录并在该目录下写文件

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:背景色
             ......

方法多态与Duck typing;C#之拙劣与F#之优雅

文 / 李博(光宇广贞)
方法多态与类型多态
       了解 OOP 的同学对类型多态都很熟悉了。话说,类型多态之多态便体现在方法上,那方法多态又是嘛玩儿?类型多态之类型指的是对像的类型,其方法是受对像约束的。方法多态便是不受对像类型约束的多态。具体区别在:

方法多态无需继承 ......

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  ......

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号