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

lsp69 2016-07-18 11:00:40
<?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;

?>
...全文
157 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
浩方软件HFWMS 2016-07-19
  • 打赏
  • 举报
回复
没有人会吗,各位大哥帮帮忙

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧