示例#1
0
        string Gen()
        {
            string str = textFormat.Text;

            while (str.Contains("%char%"))
            {
                str = PXL.ReplaceFirst(str, "%char%", RandomUtils.GenChar(rand).ToString());
            }
            while (str.Contains("%CHAR%"))
            {
                str = PXL.ReplaceFirst(str, "%CHAR%", RandomUtils.GenChar(rand).ToString().ToUpper());
            }
            while (str.Contains("%num%"))
            {
                str = PXL.ReplaceFirst(str, "%num%", RandomUtils.GenNumber(rand).ToString());
            }
            while (str.Contains("%rand%"))
            {
                str = PXL.ReplaceFirst(str, "%rand%", RandomUtils.GenRandom(rand, true).ToString());
            }
            while (str.Contains("%randws%"))
            {
                str = PXL.ReplaceFirst(str, "%randws%", RandomUtils.GenRandom(rand, false).ToString());
            }
            while (str.Contains("%sym%"))
            {
                str = PXL.ReplaceFirst(str, "%sym%", RandomUtils.GenSymbol(rand).ToString());
            }
            return(str);
        }