ASP.NET常识整理
来源:互联网 发布:农村淘宝绑定有坏处吗 编辑:程序博客网 时间:2024/04/30 21:15
弹出窗口:
Response.Write("<script>window.alert('您已经注册成功!')</script>");
Response.Write("<script>window.top.location='index.aspx'</script>");
如何去掉str后x位字符?只要前面的字符:
string tmp = str.SubString(0,str.Length-x);
如何保留str前i位字符:
string tmp = str.SubString(0,i);
如何去掉str前i位字符:
string tmp = str.SubString(x);
如何去掉str中的abc字符,如果有的话:
string tmp = str.Replace("abc","");
跳出这个if语句用break
跳出函数用return
当返回值是void的时候用return;
当返回值有具体数据类型的时候要返回相应的数据类型。
//跳页
this.Response.Write("<script>window.location.href='contlist.aspx'</script>");
//关闭
this.Response.Write("<script language=javascript>window.close();</script>");
//弹出窗口刷新当前页面width=200 height=200菜单。工具条没有
//this.Response.Write("<script language=javascript>window.open('rows.aspx','newwindow','width=200,height=200')</script>");
//弹出窗口刷新当前页面有菜单。工具条
//Response.Write("<script language=javascript>window.open('rows.aspx')</script>");
//弹出窗口刷新当前页面有菜单。工具条。弹出窗口居中
//Response.Write("<script>window.open('rows.aspx','_blank');</" + "script>");
//弹出窗口刷新当前页面有菜单。工具条。
//this.RegisterStartupScript("OpenNewPage","<script language=javascript>window.open('rows.aspx?ID="+e.ToString()+"','_blank');</script>");
//单点第一页刷新第二页
Response.Write("<script language=javascript>window.opener.location.href=window.opener.location.href</script>");
//刷新父关闭当前
Response.Write("<script language='javascript'>window.opener.location.href=window.opener.location.href;window.close();</script>");
Response.Write("<script language='javascript'>window.opener.location.href=window.opener.location.href;window.close();</script>");
this.Response.Write("<script language=javascript>window.open('WebForm3.aspx','newwindow','width=200,height=200,top=200,left=400')</script>");
this.Response.Write("<script language=javascript>window.open('WebForm3.aspx','_blank','width=200,height=200,top=200,left=400');</script>");
ip地址的使用:
string hostIP=System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName()).AddressList[0].ToString();
this.Image1.ImageUrl="http://"+hostIP+"/mtamap/000001.bmp";
//利用主机ip127.0.0.1得到主机名字
IPHostEntry hostInfo=Dns.GetHostByAddress("127.0.0.1");
string hostname=hostInfo.HostName.ToString();
//定位到另一个目录
string url="http://"+hostname+"/mtamap/"+Session["str"].ToString()+".bmp";
this.Response.Redirect(url);
//隐藏菜单栏地址栏工具条的IE,以下变量分别是新窗口的名字,窗口的宽度、高度,有滚动条,窗口距离屏幕上方和左侧的象素 //e.Item.Attributes.Add("onclick","window.open('pdetail.aspx?ID="+e.Item.Cells[1].Text+"','newwin','width=750,height=600,scrollbars=yes,top=50,left=50');");
string s="abc村械地23423";
int byteCount=System.Text.Encoding.Default.GetByteCount(s);
byteCount得到字符串变量里面的字符串所占字节数
- ASP.NET常识整理
- ASP.NET常识整理
- ASP.NET常识整理
- ASP.NET常识整理
- ASP.NET常识整理
- ASP.NET有关目录操作的常识
- ASP.NET有关目录操作的常识
- ASP.NET有关目录操作的常识
- ASP.NET有关目录操作的常识
- 一些很基础的ASP.NET常识
- 常用ASP-NET常识解析预处理
- Asp.Net 整理(文件)
- ASP.NET大整理
- ASP.NET大整理
- ASP.NET整理:TreeView
- Asp.net技术整理
- .Net理论常识整理——第一日
- ASP.NET错误搜集整理
- MSDN Library May 2006 Edition 微软官方下载
- 数清楚代码行也不容易
- SQA可否拥有项目控制权利?
- 今天进行了一个小规模的Case Study
- 神坛之上的CMM——解析CMM和中国软件
- ASP.NET常识整理
- 小时候的语文课本
- 将字符转置
- ASP.NET常用代码
- 游戏进阶之千里之行始于足下(一)
- 憎恨虚伪
- 凤凰涅槃
- Delphi得到系统目录
- 一封让老板看后一夜没睡的辞职信