Necesito este código PHP convertido a C#. ¿Hay alguna herramienta o sitio web que lo haga posible?php to C# converter
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;
}
Esto parece ser parte de algo más grande. ¿Qué aspecto necesita traducir exactamente? La parte curl? –
Relacionados: http: // stackoverflow.com/questions/441161/how-to-convert-code-from-c-to-php – RQDQ
Puede que no sea lo que estás buscando, pero Facebooks HipHop para PHP convierte PHP a C++. (Sí, sé que estás pidiendo C#, pero esto es lo más cercano que se me ocurre: D). Realmente no obtiene ningún código convertido, pero aumenta su rendimiento si eso es lo que está buscando. – Sondre