///
Namespace Abraxas {///
/ / Generate random string private string randomstring (int bit) {string charS = "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, G, H, I, J, K, L, M, N, O, P, Q, R, Y, T, U, V, W, X, Y, Z "; String [] Chararray = Chars.Split ( ','); String result = ""; random rdm = new random (); for (int i = 0; i // Draw the verification code into graphical void drawimage (String Valcode) {// Generate bitmap bitmap bmp = new bitmap (Valcode.length * 16, 25); graphics g = graphics.fromage (bmp); try {g. Clear (color.white); // Define color and font set color [] c = {color.red, color.green, color.navy, color.darkcyan, color.blue, color.purple}; string [] fonts = {"Microsoft Sans Serif", "Times New Roman", "Lucida Console", "Arial", "Verdana"} // Draw background grid Pen P = new pen (color.lightgray, 0); int y = 5; do {g.drawline (p, 0, y, bmp.width, y); y = 5;} while (Y // Draw the border G. DrawRectangle (P, 0, 0, bmp.width-1, bmp.height-1); // output to the page MemoryStream ms = new MemoryStream (); bmp.Save (ms, System.Drawing.Imaging.ImageFormat.Gif); Response.Cache.SetNoStore (); Response.ClearContent (); Response.ContentType = "image / Gif "; response.binaryWrite (ms.toarray ()); response.end ();} finally {g.dispose (); bmp.dispose ();}} #Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} ///