void Fetcher::fetch()
{
// declare variable
eString url, code;
code = mytext->getText();
// assign to the variable the url we want to connect
url = "http://www.host.com/fine.php?actvcode="+code;
// assign to class variable the temporary file we will use to store the dowanloaded data
tempPath = "/var/keys/file save";
// inizialize the control error flag
int error = 0;
// start connection
connectionP = eHTTPConnection::doRequest(url.c_str(), eApp, &error);
//Show a Messagebox in case of connection error
if(!connectionP || error)
{ eMessageBox msg("Error Activation " + url + "(" + eString().sprintf("%d", error) + ")", _("Details"), eMessageBox::btOK);
msg.show(); msg.exec(); msg.hide();
}
else
{
//if the connection is estabilished start the download funcions
CONNECT(connectionP->transferDone, Fetcher::transferDone);
CONNECT(connectionP->createDataSource, Fetcher::createDownloadSink);
// set the user-agent name
connectionP->local_header["User-Agent"] = "PLBOT";
connectionP->start();
}
}
Essentially, you would encrypt the string using some encryption routine (either made up yourself or use a standard algorithm) then you would decrypt the string in your source.
Say you want to encrypt "http://www.host.com/fine.php?actvcode=". Also say you have an encryption routine which encrypts that string to "iuuq;,,xxx[iptu[dpn,gjof[qiq^bduwdpef<" (notice that this is a simple hash).
Your code would then look something like this:
1 2 3 4 5 6 7
void Fetcher::fetch()
{
// declare variable
eString url, code;
code = mytext->getText();
// assign to the variable the url we want to connect
url = Decrypt("iuuq;,,xxx[iptu[dpn,gjof[qiq^bduwdpef<")+code;
where in this case Decrypt returns the decrypted eString.
Giving complete solutions is frowned upon here. Depending on how strong you want your encryption, you could easily code it yourself. You can also easily find more advanced solutions online.