Curl to VB.net conversion
ive searched everywhere and cannot find how to post data using vb.net
So i was wondering if someone can convert this curl code I made into vb.net :)$useragent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_RETURNTR开发者_如何学GoANSFER, TRUE ); // return into a variable
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec( $ch ); // run!
curl_close($ch);
$data being an array, not sure how it will work in vb.net though.
CURL is an independent application and a PHP extension allows you to utilize it seamlessly from inside PHP code. So you can install CURL and get it work via your shell commands from .NET ... while at the same time you might find this useful as well.
http://curl.haxx.se/libcurl/dotnet/
精彩评论