怎样把这段PHP代码转换成asp.net (C#),在线等
<?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;
?>
$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;
?>
...全文
相关推荐
ASP在线编辑器,ASP.NET在线编辑器,PHP在线编辑器,JSP在线编辑器.html在线编辑器,在线网页编辑器
**ASP.NET在线编辑器**:ASP.NET是ASP的升级版,基于.NET框架,支持多种编程语言如C#和VB.NET。
ASP|ASP.NET|JSP|PHP都可以使用的在线客服源码
ASP.NET是ASP的升级版,基于.NET框架,提供了更加强大的功能和安全性。它支持面向对象编程,能够利用C#或VB.NET等语言编写代码。
基于ASP.NET企业在线记账平台源码.zip
- C#:作为ASP.NET的核心语言,C#是构建此类平台的主要编程语言。它具有类型安全、面向对象的特性,支持.NET框架,使得开发者能快速开发出稳定且高效的代码。
网络硬盘(C#,php,asp源代码)
本主题将深入探讨如何使用C#, PHP和ASP这三种编程语言来实现网络硬盘的功能。这些源代码提供了一种简单而实用的方法,帮助开发者快速构建自己的网络硬盘应用。首先,我们来看C#实现的网络硬盘。
在线书店(asp,jsp,asp.net,php)毕业设计
在线书店的毕业设计是一个综合性的项目,涉及到多种Web开发技术,包括ASP(Active Server Pages)、JSP(JavaServer Pages)、ASP.NET以及PHP。


