By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

Producing a graphic from Text

P: n/a
Hi,

I am just about to write a registration screen for a web based application.
I have seen and used registration screens that show the user a graphic
containing randon text that they are asked to type in a box below the
graphic. I believe this is to stop automaton's automatically creating
multiple accounts without any human interaction.

From memory I think this method is used when registering for a hotmail
account.

Does anybody know how I can do this, i.e. Produce a graphic from randomly
generated text, in .Net?, and in particular is there any .net code out there
(VB.Net ideally), or component that does this job?
Thanks, Mike.
Jun 23 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
V
I don't know if this is what you are looking for, but I would use
either of the two approaches below:

1. Use GDI+ classes, to draw a bitmap based on a text, and then show it
at the runtime.

2. Better yet, I would simply create a small database of images and
store them with their texts, and rotate them randomly for the website.

But if there are libraries or controls which server specifically this
purpose, I am not aware of that.

- Vaibhav

Mike Owen wrote:
Hi,

I am just about to write a registration screen for a web based application.
I have seen and used registration screens that show the user a graphic
containing randon text that they are asked to type in a box below the
graphic. I believe this is to stop automaton's automatically creating
multiple accounts without any human interaction.

From memory I think this method is used when registering for a hotmail
account.

Does anybody know how I can do this, i.e. Produce a graphic from randomly
generated text, in .Net?, and in particular is there any .net code out there
(VB.Net ideally), or component that does this job?
Thanks, Mike.


Jun 23 '06 #2

P: n/a
Thanks Vaibhav.

The 'small database of images' sounds like a good idea, and it would
probably be good enough.

I wonder if anybody else knows if this is how sites like msn do it, or is
there some cunning code out there that already does the job?
Cheers, Mike.

"V" wrote:
I don't know if this is what you are looking for, but I would use
either of the two approaches below:

1. Use GDI+ classes, to draw a bitmap based on a text, and then show it
at the runtime.

2. Better yet, I would simply create a small database of images and
store them with their texts, and rotate them randomly for the website.

But if there are libraries or controls which server specifically this
purpose, I am not aware of that.

- Vaibhav

Mike Owen wrote:
Hi,

I am just about to write a registration screen for a web based application.
I have seen and used registration screens that show the user a graphic
containing randon text that they are asked to type in a box below the
graphic. I believe this is to stop automaton's automatically creating
multiple accounts without any human interaction.

From memory I think this method is used when registering for a hotmail
account.

Does anybody know how I can do this, i.e. Produce a graphic from randomly
generated text, in .Net?, and in particular is there any .net code out there
(VB.Net ideally), or component that does this job?
Thanks, Mike.


Jun 23 '06 #3

P: n/a
Hello Mike,

The term you are looking for is CAPCHA (what a horrid name).. anyhow, look
it up on google.

-Boo
Thanks Vaibhav.

The 'small database of images' sounds like a good idea, and it would
probably be good enough.

I wonder if anybody else knows if this is how sites like msn do it, or
is there some cunning code out there that already does the job?

Cheers, Mike.

"V" wrote:
I don't know if this is what you are looking for, but I would use
either of the two approaches below:

1. Use GDI+ classes, to draw a bitmap based on a text, and then show
it at the runtime.

2. Better yet, I would simply create a small database of images and
store them with their texts, and rotate them randomly for the
website.

But if there are libraries or controls which server specifically this
purpose, I am not aware of that.

- Vaibhav

Mike Owen wrote:
Hi,

I am just about to write a registration screen for a web based
application. I have seen and used registration screens that show the
user a graphic containing randon text that they are asked to type in
a box below the graphic. I believe this is to stop automaton's
automatically creating multiple accounts without any human
interaction.

From memory I think this method is used when registering for a
hotmail account.

Does anybody know how I can do this, i.e. Produce a graphic from
randomly generated text, in .Net?, and in particular is there any
.net code out there (VB.Net ideally), or component that does this
job?

Thanks, Mike.

Jun 23 '06 #4

P: n/a
Hi Mike,

Thanks for your post!

The small database images solution is not perfect to achieve the really
random image. While the GDI+ dynamically generated image is more flexible
and it is very simple to implement. You just need to use
Graphics.DrawString method to write out the string to a Graphics object,
and then save it to the Response.OutputStream for displaying.

The article below shows you the full code snippet regarding doing this:
"How to Create Text Image on the fly with ASP.NET"
http://www.codeproject.com/aspnet/createTextImage.asp

The 2 articles below demonstrate more the power of GDI+ for dynamic image
generating:
"Create Snazzy Web Charts and Graphics On the Fly with the .NET Framework"
http://msdn.microsoft.com/msdnmag/is...w/default.aspx
"ASP.NET Controls to prevent automatic registrations from bots"
http://www.codeproject.com/aspnet/antiauto.asp

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 26 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.