怎样把这段PHP代码转换成asp.net (C#),在线等

浩方软件HFWMS 浩方软件HFWMS 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<?php

$datefirst = '2016-07-17T11:40:04';
$account = '97ec59850e41d3fcd6b35bec2ca44382';
$password = 'b6a29ee7402e728e0ebe3a5a611b0747';
$secure = md5($datefirst."&".$password);

$xml_request = '<?xml version="1.0" encoding="UTF-8" ?>
<DeliveryRequest Number="477" Date="'.$datefirst.'" Account="'.$account.'" Secure="'.$secure.'" OrderCount="1">
<Order Number="863423132451"
DeliveryRecipientCost="0"
SendCityPostCode="125137"
RecCityPostCode="443000"
Address="fdsafsd4333232"
RecipientName="asa22233"
Phone="9171155969"
Comment="eww232323232"
SellerName="ddsdsewew"
TariffTypeCode="137">
<Package Number="1" BarCode="16343245" Weight="1145">
<Item WareKey="1" Cost="2015.00" Payment="0.00" Weight="1145" Amount="1" Comment="5555"/>
<Item WareKey="2" Cost="2015.00" Payment="0.00" Weight="1145" Amount="1" Comment="888888"/>
</Package>
<Call SendCityCode="44" SendAddress="127137, street " SendPhone="84957899166" SenderName="MaxiPost"></Call>
</Order>

</DeliveryRequest>';

$account = '97ec59850e41d3fcd6b35bec2ca44382';
$password = 'b6a29ee7402e728e0ebe3a5a611b0747';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://gw.edostavka.ru:11443/new_orders.php/");
curl_setopt($ch, CURLOPT_USERPWD, "$account.':'.$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_PROXY,'127.0.0.1:8888');//设置代理服务器
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('xml_request' => "$xml_request"));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: close'));
$result = curl_exec($ch);// 执行并获取HTML文档内容

curl_close($ch);// 释放curl句柄


header( "Content-Type: text/xml; charset=UTF-8");
echo $result;

?>
...全文

相关推荐

评论 1
收藏 已收藏
分享
返回顶部
浩方软件HFWMS
.NET社区 62,271 成员 668,968 内容