Bir Php Kodunu Nasıl C# Çevirriz
-
arkadaşlar c# de yapmak istediğim olayı phpde buldum :D nasıl çevirebilirm ?
<?
error_reporting(0);
echo 'UO Kings ' . pingServer('77.245.151.238', '22') . '<br>';
function pingServer( $url, $port ) {
if ( !$sock = fsockopen( $url, $port, $num, $error, 5 ) )
$oyuncu = -1;
else {
fwrite( $sock, "\x7f\x00\x00\x01" );
fwrite( $sock, "\xf1\x00\x04\xff" );
$contents = fgets( $sock );
preg_match( '/(Clients=)([0-9]{1,}),/', $contents, $playersOnline );
preg_match( '/(Items=)([0-9]{1,}),/', $contents, $items );
preg_match( '/(Chars=)([0-9]{1,}),/', $contents, $chars );
$oyuncu = $playersOnline[2] - 1;
$item = $items[2];
$mobiles = $chars[2];
return $oyuncu;
fclose( $sock ); }
return;
} -
Korghi UO Kings falan ne iş :)
-
Ne yapmak istiyorsun ki C#'ta ?
-
Sanırım ben yapmak istediğini anladım. UO kings'in kullandığı bağlantı programında orada yazan oyuncu sayısını cartını curtunu göstermek istiyor sanırım.
-
hacı şimdi yanlış hatırlamıyorsam uo kingsin connectorunde internet sitesinden haberler gözüküyordu. o haberlerin gözüktügü yerin altına o php kodunu çak oda gözüksün ?
-
webrequest bunun adı C#.net de
biraz araştır istersen, olmazsa ben yardımcı olurum...
