Avatar of freylicher
freylicher

asked on 

Query a web site from a windows program written in C

I need to add functionality to a windows program written in C (no MFC). This program should be able to access and get information from a certain web site. This web site is for the registered users, who could login and download program updates. Right now I just want the windows program to query the site’s database and determine, if the specified user name belongs to a registered user.
Microsoft DevelopmentC

Avatar of undefined
Last Comment
Infinity08
ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of freylicher
freylicher

ASKER

Thank you, Infinity08.

I shall check this library. Did you use it in your C programs? Will it work with password protected site?

Thanks again,

-alex


Avatar of Infinity08
Infinity08
Flag of Belgium image

Yes, I have used it myself, and yes, it does support HTTPS.

Take a look at basic this example :

http://curl.haxx.se/lxr/source/docs/examples/https.c

You'll find a lot more examples and documentation on the site.
Avatar of freylicher
freylicher

ASKER

Well, this is not https site. I meant that the users have to login like in experts-exchange site.
Avatar of Infinity08
Infinity08
Flag of Belgium image

That's usually done using forms, so you can simply use the form functionality in libcurl. Here's an example that should get you on the right track. It doesn't log in, but it uploads a file through a form :

      http://curl.haxx.se/lxr/source/docs/examples/postit2.c

The principle is the same though. Instead of sendfile and filename, you'll have login and password.

Basically, you'll have to look for the definition of the login form (look at the HTML source of the web page you want to login to), and fill in all parameters using curl_formadd, and then send it.
Avatar of freylicher
freylicher

ASKER

Infinity08,

I did not have a chance to try the library yet, but you answered my question and 500 points are yours.
I may have more questions when I start working on this problem. If you are interested to do some consulting for me, please send me a message to 2006 at www.freylicher.com

Thanks again,
-alex
Avatar of Infinity08
Infinity08
Flag of Belgium image

Glad I could be of assistance. I'll be glad to answer any further questions (if I have the answer :)).
Avatar of freylicher
freylicher

ASKER

<<I'll be glad to answer any further questions>>

After I award the points I am not sure we shall be able to communicate in this thread. That's why I wanted to establish email connection. I should really appreciate getting email from you.

Thank you,
-alex
Avatar of Infinity08
Infinity08
Flag of Belgium image

>> After I award the points I am not sure we shall be able to communicate in this thread.
This thread will still be open after you accept an answer. I'll still receive a notification when you post a follow-up question, and I will respond over here.
Microsoft Development
Microsoft Development

Most development for the Microsoft platform is done utilizing the technologies supported by the.NET framework. Other development is done using Visual Basic for Applications (VBA) for programs like Access, Excel, Word and Outlook, with PowerShell for scripting, or with SQL for large databases.

48K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo