Overview
Features
Download
Documentation
Community
Add-Ons & Services

C# WebCLient equivalent in POCO?

Please post support and help requests here.

C# WebCLient equivalent in POCO?

Postby andrei » 15 May 2013, 18:33

I have an IP camera that is connected wirelessly. Accessing the camera online requires a username and password and will show a single image.

I was able to download the image using WebClient in C#. Now, I'm planning to do so in C++ and was wondering if there is anything similar to it in POCO? Thanks!
andrei
 
Posts: 2
Joined: 15 May 2013, 18:18

Re: C# WebCLient equivalent in POCO?

Postby guenter » 15 May 2013, 19:16

You can use the Poco::Net::HTTPClientSession class.
Sample code is here: https://github.com/pocoproject/poco/blo ... ttpget.cpp
guenter
 
Posts: 1138
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: C# WebCLient equivalent in POCO?

Postby andrei » 16 May 2013, 08:48

I used the above code and I managed to connect to the IP Camera. Now, I'm trying to download the stream into a jpeg file.
I tried using the code from http://stackoverflow.com/questions/8862 ... ing-poco-c . However, i seemed to have errors on the ofstream outfile;

If I write std::ofstream outfile; , I get "Error: Incomplete type is not allowed"
When i change it to std::ofstream *outfile; it doesn't have any errors but I got errors on outfile.open( "myfile.jpg" ); I tried using outfile->open( "myfile.jpg" ); but it stil gives me error.

If I add #include <fstream>, there are no errors. However, if I tried compiling it, I get fatal error LNK1169: one or more multiply defined symbols found

Is there any other way to save the stream? Thanks.
andrei
 
Posts: 2
Joined: 15 May 2013, 18:18


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest