日期:2014-05-18 浏览次数:20821 次
string s = "ABCD**"; Random r = new Random(); string ss = Regex.Replace(s, @"\*", delegate(Match match) { return r.Next(10).ToString(); }); Response.Write(ss);
------解决方案--------------------
string s = "ABCD**"; string ss = s.Replace("*", ""); int count = s.Length - ss.Length; for (int i = 0; i < Math.Pow(10, count); i++) { string r = ss + i.ToString("D" + count); Response.Write(r + "<br/>"); }