Answer the question
In order to leave comments, you need to log in
How to translate php code to asp.net?
Good day to all! Could you help me with the translation of the functionality of the php class to asp.net asp.net I know, but I can’t figure it out in php - I’ll give part of the code in php -
//=================================================
function getData($proc,$parm=false) {
if(!$parm) $parm = array();
$command = array('proc_id'=>$proc,'parm'=>$parm);
$auth = array('client_name'=>$this->client_name,'client_pwd'=>$this->client_pwd);
$data = array('command'=>$command,'auth'=>$auth);
$data = $this->sendPost($this->server,$data);
return $data;
}
//=================================================
function sendPost($url,$data) {
$data = array('postdata'=>serialize($data));
$data = array_map($this->code_method.'encode',$data);
// Что он в дату сохраняет ? какие параметры получаются с точки зрения http после того // как мы сохраняем массив в массиве массива ?
$data = http_build_query($data);
$post = $this->genPost($url,$data);
$url = parse_url($url);
$fp = @fsockopen($url['host'], 80, $errno, $errstr, 30);
if (!$fp) return false;
$responce = '';
fwrite($fp,$post);
while ( !feof($fp) )
$responce .= fgets($fp);
fclose($fp);
//var_dump('<pre>',$responce); // (отладка - показать ошибки php в вызываемом модуле)
$responce = $this->NormalizePostResponce($responce);
return $responce;
}
Answer the question
In order to leave comments, you need to log in
As I understand it, you do not understand the piece
$data = array_map($this->code_method.'encode',$data);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question