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

Captcha in C# Windows Application

P: 3
Hi, I have a captcha script on my website located at /captcha.php. What it does it generates an image with the code, displays the image (gd2) and saves the value of the code in session.

How do I access that code in session from my c# windows application. I have a form in my application for registering users. The application then calls to the webserver and uses regular .php page to submit user registration. It has captcha and thats why I need to use it in my c# application too.

What I have done so far is:
1) create form in the application
2) set up all up so data is sent to the server using webRequest
3) placed a PictureBox on the form and binded it to my captcha script www.example.com/captcha.php. The captcha image get displayed correctly in the PictureBox.

How do I get the value of the captcha code stored in session every time i call www.example.com/captcha.php

Regards,
Anton
Nov 9 '07 #1
Share this Question
Share on Google+
4 Replies


Plater
Expert 5K+
P: 7,872
How would you get at it in php?
(You could probably just make a C# version of captcha anyway?)
Nov 9 '07 #2

P: 3
Making a c# version of captcha will not work in my situation as i am submitting everything from my c# application to a website. And the webpage where I am submitting to has a captcha check. Thats why I need to be able to read the website captcha value that is stored in session when i call a captcha.php script (which generates a image contenttype = image/jpg).

I can display that image in my picture box in c# app but dont seem to be abe to read the value of captcha code in session.

How would you get at it in php?
(You could probably just make a C# version of captcha anyway?)
Nov 10 '07 #3

Plater
Expert 5K+
P: 7,872
Well that would make you on the side of the "client" and clients aren't supposed to have access to the Session. That would defeat the purpose.
Speaking of defeating purposes, captcha is supposed to ensure human input, not a "bot". And that category, is what you are now falling into.
Nov 12 '07 #4

P: 3
You are absolutely right! Coming from a web developer world, i was a bit lost. Thank you for clearing my vision. What I will now do is implement captcha inside the c# app and modify the server a bit to allow my app bypass the server captcha mechanism.

Thanks again

Anton

Well that would make you on the side of the "client" and clients aren't supposed to have access to the Session. That would defeat the purpose.
Speaking of defeating purposes, captcha is supposed to ensure human input, not a "bot". And that category, is what you are now falling into.
Nov 13 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.