悟生慧

 

2011年4月7日

ASP.NET返回页面的方法

摘要: if (!IsPostBack) { ViewState["BackUrl"] = Request.UrlReferrer.ToString(); }///返回Response.Redirect(ViewState["BackUrl"].ToString()); 阅读全文

posted @ 2011-04-07 19:12 悟生慧 阅读(228) 评论(0) 推荐(0)

GridView中显示行号

摘要: <asp:TemplateField HeaderText="行号"> <ItemTemplate> <asp:Label ID="Label2" runat="server" Text='<%#Container.DataItemIndex+1 %>'></asp:Label> </ItemTemplate></asp:TemplateField> 阅读全文

posted @ 2011-04-07 19:03 悟生慧 阅读(473) 评论(0) 推荐(0)

C#随机不重复数字字符串2

摘要: 方法一:随机生成不重复数字字符串 privateintrep=0;//////生成随机数字字符串//////待生成的位数///生成的数字字符串privatestringGenerateCheckCodeNum(intcodeCount){stringstr=string.Empty;longnum2=DateTime.Now.Ticks+this.rep;this.rep++;Randomrandom=newRandom(((int)(((ulong)num2)&0xffffffffL))|((int)(num2>>this.rep)));for(inti=0;i<c 阅读全文

posted @ 2011-04-07 13:26 悟生慧 阅读(841) 评论(0) 推荐(0)

自动生成不重复的含有数字和字母的随机码

摘要: /*** 随机代码生成,长度不超过36* 自动生成不重复的含有数字和字母的随机码*/package src;import java.util.ArrayList;public class Test { public static void main(String[] args) throws IndexOutOfBoundsException { ArrayList list = new ArrayList(); // list.add(1); for (int i = 0; i < 10; i++) list.add(i); for (char c = 'a'; c & 阅读全文

posted @ 2011-04-07 11:44 悟生慧 阅读(2128) 评论(0) 推荐(0)

C#生成拼音简码

摘要: ///<summary> ///生成拼音简码 ///</summary> ///<paramname="unicodeString">Unicode编码字符串</param> ///<returns>拼音简码:string</returns> publicstaticstringGetPinyinCode(stringunicodeString) { inti=0; ushortkey=0; stringstrResult=string.Empty;//创建两个不同的encoding对象 Encodin 阅读全文

posted @ 2011-04-07 11:40 悟生慧 阅读(1895) 评论(1) 推荐(0)

C#汉字生成拼音全拼

摘要: #region拼音编码 privatestaticint[]pyValue=newint[] { -20319,-20317,-20304,-20295,-20292,-20283,-20265,-20257,-20242,-20230,-20051,-20036, -20032,-20026,-20002,-19990,-19986,-19982,-19976,-19805,-19784,-19775,-19774,-19763, -19756,-19751,-19746,-19741,-19739,-19728,-19725,-19715,-19540,-19531,-19525,-195 阅读全文

posted @ 2011-04-07 11:39 悟生慧 阅读(2455) 评论(0) 推荐(0)

导航