如何使用 BlackBerry Native Library 在 C++ 中复制此类功能?
$username="admin";
$password="admin";
$url="http://www.yourdomain.com/";
$cookie="cookie.txt";
$postdata = "log=". $username ."&pwd=". $password ."&wp-submit=Log%20In&redirect_to=".
$url ."wp-admin/&testcookie=1";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $url . "wp-login.php");
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt ($ch, CURLOPT_REFERER, $url . "wp-admin/");
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
$result = curl_exec ($ch);
curl_close($ch);
echo $result;
exit;
BlackBerry Native Library 中的请求通常如下所示:
QNetworkAccessManager* networkAccessManager = new QNetworkAccessManager(this);
const QString queryUri = QString::fromLatin1("http://website.com/get.php?email=%1").arg(email);
QNetworkRequest request(queryUri);
QNetworkReply* reply = networkAccessManager->get(request);
任何信息或正确方向的点都会令人惊叹!