PHP Code:
Code 1:
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, 'http://www.mirrorupload.net/api/server.html');
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$output = curl_exec($ch);
curl_close($ch);
Code 2:
$postmember = array ();
$postmember['login'] = 'Your login';
$postmember['pass'] = 'Your password';
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, 'http://www.mirrorupload.net/api/member.html');
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postmember);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$output = curl_exec($ch);
curl_close($ch);
Code 3:
$postfile = array ();
$postfile['file'] = '@path_file';
$postfile['session_id'] = 'Your Session_id';
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, 'See above');
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postfile);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
$output = curl_exec($ch);
curl_close($ch);
I am new to c# and don't know anything about php. I was trying to upload files automatically using api. I search the net form POST methods and Webrequest and stuff but I really don't know how to include these thing in my C# program. So, it'll be really helpful if somebody explains what actually those codes mean and their equivalent c# code. Please convert these codes to C# for me. It would make sense.