J'ai besoin de ce code PHP converti en C#. Y a-t-il un outil ou un site Web qui rendrait cela possible?Convertisseur php en C#
public function call($method, array $params) {
// Add the format parameter, only 'json' is supported at the moment
if (!array_key_exists('format', $params)) {
$params['format'] = 'json';
}
$url = "{$this->_url}/{$method}";
$ch = $this->_getCurlHandle($url);
if (!$ch) {
throw new Fuze_Client_Exception("Unable to create a cURL handle");
}
// Set the request parameters
$queryString = http_build_query($params);
curl_setopt($ch, CURLOPT_POSTFIELDS, $queryString);
// Fire!
$result = $this->_executeCurl($ch);
// All API response payloads should be valid json with 'code' and
// 'message' members
$json = json_decode($result);
if (!($json instanceof stdClass)
|| !isset($json->code)
|| !isset($json->message)) {
throw new Fuze_Client_ServerException(
"Invalid JSON payload received", $result, $info['http_code']);
}
if ($json->code >= 500 && $json->code < 600) {
throw new Fuze_Client_FaultException($json);
}
return $json;
}
Cela semble faire partie de quelque chose de plus. De quel aspect avez-vous besoin exactement traduit? La partie de boucle? –
En relation: http: // stackoverflow.com/questions/441161/comment-convertir-code-de-c-a-php – RQDQ
Peut-être pas ce que vous cherchez, mais Facebook HipHop pour PHP convertit PHP en C++. (Oui, je sais que vous demandez C#, mais c'est la chose la plus proche que je puisse penser: D). Ne vous procure pas vraiment de code converti, mais augmente vos performances si c'est ce que vous recherchez. – Sondre