public void Autogenerate(string gen, long count) { string s = PXL.GetDateTimeNow(); for (long i = 0; i < count; i++) { if (CancelAutogen) { CancelAutogen = false; return; } File.AppendAllText(Program.Path + "AutoGen_" + s + ".txt", RandomUtils.ByTemplate(gen, Program.rand) + "\n"); } }
static void Main(string[] args) { Directory.CreateDirectory(Path); if (args.Length == 2) { long l; if (long.TryParse(args[1], out l)) { new XRUtils().Autogenerate(args[0], l); } } else if (args.Length == 1) { Console.WriteLine(RandomUtils.ByTemplate(args[0], rand)); } else { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); ins = new xRandomer(); Application.Run(ins); } }
private void btnGenerate_Click(object sender, EventArgs e) { boxGenerated.Text = RandomUtils.ByTemplate(boxTemplate.Text, Program.rand); }