Captcha image

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mathewgk80
    New Member
    • Sep 2007
    • 103

    #1

    Captcha image

    Hi all,

    I displaed some random numbers in a textbox..

    I am having a captcha image and i would like to display that random numbers in captcha image..

    The code i used to display the random numbers in a textbox is shown below...

    Random r = new Random();
    StringBuilder sb = new StringBuilder() ;

    string s= "A67Bt12uvwxyEF XYZaKLMpqrsz345 NOPQRSTUVWbcdef ghijklmno890";

    for(int i=0;i<10;i++)
    {
    txtRandom.Text = sb.Append(s[r.Next(i)]).ToString();

    }

    Please help me display the random numbers in an image...

    Regards,

    Mathew
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Create a bitmap class. Get the Graphics object for it.
    Then use the DrawString() function.
    Also, check google.

    Comment

    • mathewgk80
      New Member
      • Sep 2007
      • 103

      #3
      Originally posted by Plater
      Create a bitmap class. Get the Graphics object for it.
      Then use the DrawString() function.
      Also, check google.

      Hi Plator,

      I dont know how to create a bitmap class and diplay the text in the image...

      Please help me...

      Regards,
      Mathew

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        As I suggested, google can find you things.

        http://msdn2.microsoft.com/en-us/lib...ng.bitmap.aspx

        Comment

        • 6502kid
          New Member
          • Mar 2008
          • 6

          #5
          This example shows how to make that happen:

          http://jcaptcha.webreg istrationservic es.com/

          Comment

          Working...