运用Server获取地址和对字符串编码和解码
使用Server获取地址
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Server.Mappath方法攻取虚拟路径所对应的物理路径!");
Response.Write(Server.MapPath("/Response"));//Response.Write(Server.MapPath("/www.aiyiweb.com"));
}
使用Server对字符串编码和解码
protected void Button1_Click(object sender, EventArgs e)
{
string str = TextBox1.Text;
Label1.Text = Server.UrlEncode(str);//Server对字符串编码
}
protected void Button2_Click(object sender, EventArgs e)
{
string str = TextBox2.Text;
Label2.Text = Server.UrlDecode(str);//Server对字符串解码
posted on 2013-05-01 16:40 1324027256 阅读(141) 评论(0) 编辑 收藏 举报