Powerbuilder does not seem to have a SFTP functionality built in (Please correct me if I'm wrong, but I couldn't find it anywhere in the documentation).
I'm assuming I have to import C/C++ DLL of SFTP to handle this problem, but I'd like to know if there's any better alternatives.
Also, are there any examples I can look at for how SFTP is done in powerbuilder?
I'm using Powerbuilder 10.2.1
You might look at this sample:
http://www.topwizprogramming.com/freecode_ftpclient.html
When you do the HttpOpenRequest one of the flags that is passed will indicate whether it should be a secure connection (INTERNET_FLAG_SECURE).
There are also third party controls that would make it easier. For example
Dart: http://www.dart.com/samp_powerbuilder.aspx
WeOnlyDo software: http://nathanepralle.ulitzer.com/node/220784/mobile
The Topwiz FTPClient example does not do SFTP, just regular FTP. It is just a really fancy shell over WinInet.dll (part of Internet Explorer). WinInet.dll does not support SFTP. I would recommend using a 3rd party ActiveX control.
I have used this one from Classic ASP with good results:
http://www.activexperts.com/network-component/
You can create a .NET dll and use it from PB as COM component using Tamir SharpSSH library, an open source SSH library for .NET.
Related
Can someone give me an example of how to send a mail using a C++ program? I have come across some programs but they are not that descriptive. I would also like to know what other libraries are there if I need more options.
You might be interested in libcURL.
It's a great multi-platform C library which supports a lot of different protocols, including SMTP.
The official web page contains samples and tips to get you started.
Here is one that might help you.
Bindings exists for C++ (but I never used them) if you don't want to use the C interface.
You can use libquickmail, see: http://sourceforge.net/projects/libquickmail/
This simple library allows you to easily send e-mail from C/C++ with attachments and even using SMTP authentication.
It uses libcurl for the SMTP transport.
Take a look at VMime, native C++. http://www.vmime.org/
Between the examples and the test suite, you should have everything you need.
Since you added a linux tag to your question: A dirty way to send an email from a c++ program is to use the system command. You can find out how it works in any c++ reference. Then you just need to be able to send an email from the command line and you can do that (under linux) with the mail command or with mutt (if it is installed).
My question is that create a IM software like MSN or Gtalk, to have the basic function using C++.
You can use any technology and libary to do that.
Can someone give me a suggestion?
I add that this not my homework. This
is my job question.
Because I am a fresh man in my
company.
So, they give me some questions to let
me dirty my hand.
My suggestion from experience with doing this sort of thing before is to find a library that implements Jabber also known as XMPP (Google Talk) for you. That way all you have to do is create the user interface. If you are working with Windows, MSDN has some great tutorials for creating user interfaces in C++. If you are using Linux, you will probably want to look for an X windows tutorial. Other than that, check out this link for a list of C++ libraries for Jabber/XMPP.
Good luck!
It sounds like you will probably want to use a library that already knows how to interface with existing IM clients. Google Talk, for example, uses the XMPP (also known as Jabber) protocol. The XMPP website has links to a number of free C++ libraries to communicate with other XMPP clients (like Google Talk):
http://xmpp.org/software/libraries.shtml
Here is one example of a GPL XMPP library for C++: http://camaya.net/gloox/
I need to download files/read strings from a specified url in C++. I've done some research with this, cURL seems to be the most popular method. Also, I've used it before in PHP. The problem with cURL is that the lib is huge, and my file has to be small. I think you can do it with winsock, but I can't find any simple examples. If you have a simple winsock example, a light cURL/Something else, or anything that could get the job done. I would greatly appreciated. Also, I need this to work with native C++.
I can repeat me answer Is it possible to handle proxies at socket level? (see also comments) about two important interfaces Windows Internet (WinINet) API and Windows HTTP Services (WinHTTP). An important restriction of WinINet is that WinINet should be not used in a service (only in GUI app.) because of possible dialogs.
you should try WinInet: this library is part of Windows operating system, and allows to download a resource identified by an URL, using either HTTP or FTP.
if you are using HTTP, you might find the InternetOpenUrl() function useful.
I'm thinking of creating an application that can use Firefox as a download manager. Is there any way to control Firefox (add downloads, start/stop downloads, etc) from an external program in C/C++?
If that is not possible, then perhaps an extension that can do that? If an extension is the only way, then how do I communicate with the extension from outside of Firefox?
You're starting with a solution, not a problem. The easier idea is to use XulRunner, the platform on which FireFox is built. You'd effectively implement your own application as a XulRunner plugin and use Necko (the network layer of XulRunner and FireFox) from there.
First of all I suggest that you familiarize yourself with developer.mozilla.org
As far as I understand, most Mozilla platform functions are available through a cross language API known as XPCOM. There's also a plugin API but it's primary aim is to visualize stuff (used by Flash, etc.).
Take a look at Gecko API. It allows third party developers to use the same technology as found in Mozilla.
For downloading files no need to use Firefox. Consider using libcurl.
Take a look at wget.
I have recently been given a task to add the ability to interact with Web Map Services to an existing MFC application and I am in need of a client-side HTTP API.
Based on my research, the leading candidates seem to be CAtlHttpClient and WinHTTP. I was curious to see if anyone had experiences they could share or opinions on which would be the better way to go (or suggestions for something else entirely).
At first glance, CAtlHttpClient seems to be a bit higher level and easier to use. However, in my research it seemed that any time people had a problem with not being able to do something with it, the answer was "use WinHTTP".
Result
I wound up using WinHTTP because WinInet displays dialog boxes and our application is usable through a COM API. I avoided Ultimate TCP/IP because I work for a large company and getting third party software approved for use in a product is a complete nightmare.
The simplest one is the WinInet MFC wrappers: CInternetSession and friends.
WinHTTP, although a different API, is built on the same model as WinInet yet provides better HTTP support (no FTP though but you probably don't care). Whether you need the extra goodies provided by WinHTTP should be examined.
A down side of WinHTTP is that ATL/MFC don't provide wrappers for it, as opposed to WinInet.
And as Rob mentioned, UltimateTCP is a excellent alternative. One of its advantages is that it's a library: you link the code into your application, thereby eliminating DLL hell potential problems. Also, it comes with full source code which might be convenient if you run into a limitation of the implementation.
Make your pick!
Try Ultimate TCP/IP available for free from here:
http://www.codeproject.com/KB/MFC/UltimateTCPIP.aspx
It's a very good library and very easy to integrate with your apps.