摘要: var MyString = "******中华人民共和国******_"; var Myinfo = MyString.Trim("*".ToCharArray()); var Myinfo1 = MyString.Trim(new char[2] { '*', '_' }); Response.Write(MyString + "\n" + Myinfo+"\n"+Myinfo1);******中华人民共和国******_中华人民共和国******_中华人民共和国 阅读全文
posted @ 2013-02-16 17:45 yellowshorts 阅读(477) 评论(2) 推荐(0) 编辑
摘要: var MyBuilder = new StringBuilder("你的工资是:"); var MySalary = 4120.24; MyBuilder.AppendFormat("{0:C}", MySalary);Response.Write(MyBuilder);//你的工资是:¥4,120.24 阅读全文
posted @ 2013-02-16 17:35 yellowshorts 阅读(140) 评论(0) 推荐(0) 编辑
摘要: var Mystring = "钓鱼岛是中国的 I love China"; var MyDate = new ASCIIEncoding(); byte[] MyBytes = MyDate.GetBytes(Mystring); var myLength = 0; for (int i = 0; i <= MyBytes.Length - 1; i++) { if (MyBytes[i] == 63)//判断是否为汉字或全脚符号 { myLength++; } myLength++; } 阅读全文
posted @ 2013-02-16 17:27 yellowshorts 阅读(397) 评论(0) 推荐(0) 编辑
摘要: 利用C#代码实现:string Url="www.baidu.com"l;Response.Write("<script language='javascript'>setTimeout(\"{location.href='" + url + "'}\",3000);</script>"); //自动跳转Button1.Attributes.Add("onclick","setTimeout(\"{location.hr 阅读全文
posted @ 2013-02-16 08:59 yellowshorts 阅读(2433) 评论(0) 推荐(0) 编辑