C# 对C的异步PHP调用# $fp=fsockopen($this->\xmlHost,443,$errno,$errstr,10); 如果(!$fp) { //回显“$errstr($errno)\n”; } 其他的 { $result=$this->curlSpost($this->xmlUrl$sendXml,10); $result=str_replace('getlicinfoold','getlicinfo',$result); $xml=新的simplexmlement($result,LIBXML_NOCDATA); fclose($fp); 返回$xml; }
上面是我需要转换为C#的一些PHP代码C# 对C的异步PHP调用# $fp=fsockopen($this->\xmlHost,443,$errno,$errstr,10); 如果(!$fp) { //回显“$errstr($errno)\n”; } 其他的 { $result=$this->curlSpost($this->xmlUrl$sendXml,10); $result=str_replace('getlicinfoold','getlicinfo',$result); $xml=新的simplexmlement($result,LIBXML_NOCDATA); fclose($fp); 返回$xml; },c#,php,asynchronous,C#,Php,Asynchronous,上面是我需要转换为C#的一些PHP代码 我的问题是使用fsockopen的目的是什么,是否有必要为c端进行转换?我不能在c#中通过WebRequest发送curl并完成它吗?只需使用WebClient类发送您的请求即可。它比使用WebRequest抽象了一点 fsockopen的异步功能是什么? $fp = fsockopen($this->_xmlHost, 443, $errno, $errstr, 10); if (!$fp) { //echo "$errstr ($errn
我的问题是使用fsockopen的目的是什么,是否有必要为c端进行转换?我不能在c#中通过WebRequest发送curl并完成它吗?只需使用WebClient类发送您的请求即可。它比使用WebRequest抽象了一点
fsockopen的异步功能是什么?
$fp = fsockopen($this->_xmlHost, 443, $errno, $errstr, 10);
if (!$fp)
{
//echo "$errstr ($errno)<br />\n";
}
else
{
$result = $this->curlSpost($this->_xmlUrl, $sendXml ,10);
$result = str_replace('getlicinfoold','getlicinfo', $result);
$xml = new SimpleXMLElement($result, LIBXML_NOCDATA);
fclose($fp);
return $xml;
}