} // End Function GetCustomFont public static byte[] Generate() { string captchaText = Markov.generateCaptchaTextMarkovClean(5); captchaText = "The quick brown fox jumps over the lazy dog"; captchaText = "test123"; byte[] imageBytes = Generate(captchaText, System.Drawing.Imaging.ImageFormat.Png); System.IO.File.WriteAllBytes(FileHelper.MapProjectPath("Img/mesh.png"), imageBytes); return(imageBytes); } // End Function Generate
public static void Main(string[] args) { Captcha3D.Generate(); string ct = Markov.generateCaptchaTextMarkov(10); string ctRand = Markov.generateCaptchaTextRandom(10); string ctClean = Markov.generateCaptchaTextMarkovClean(10); System.Console.WriteLine(ct); System.Console.WriteLine(ctRand); System.Console.WriteLine(ctClean); System.Console.WriteLine(System.Environment.NewLine); System.Console.WriteLine(" --- Press any key to continue --- "); System.Console.ReadKey(); }
public static byte[] Generate() { int rnd = (int)MathHelpers.rand(3, 6); string captchaText = Markov.generateCaptchaTextMarkovClean(rnd); // captchaText = "The quick brown fox jumps over the lazy dog"; // captchaText = "test123"; System.Console.WriteLine(captchaText); byte[] imageBytes = Generate(captchaText, System.Drawing.Imaging.ImageFormat.Png); lock (fileLock) { System.IO.File.WriteAllBytes("mesh.png", imageBytes); // System.IO.File.WriteAllBytes(captchaText + ".png", imageBytes); } // End lock (fileLock) return(imageBytes); } // End Function Generate