his is my PHP code i need to convert this part to c#. Anybody suggest me. Is there any online conversion tool available Or any equivalent c# code is also is much appreciable and if you can please help
function httpRequest($url)
{
$pattern = "/http...([0-9a-zA-Z-.]*).([0-9]*).(.*)/";
preg_match($pattern,$url,$args);
$in = '';
$fp = @fsockopen("$args[1]", $args[2], $errno, $errstr, 20);
if (!$fp)
{
$flag = 'error';
return($flag);
//return("$errstr ($errno)");
}
else
{
$out = "GET /$args[3] HTTP/1.1\r\n";
$out .= "Host: $args[1]:$args[2]\r\n";
$out .= "User-agent: Robo Recharge GPRS\r\n";
$out .= "Accept: */*\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp))
{
$in .= fgets($fp, 128);
}
}
if($fp)
{
fclose($fp);
return($in);
}
}