怎样把这段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;
?>
...全文
相关推荐
网络硬盘(C#,php,asp源代码)
本主题将深入探讨如何使用C#, PHP和ASP这三种编程语言来实现网络硬盘的功能。这些源代码提供了一种简单而实用的方法,帮助开发者快速构建自己的网络硬盘应用。首先,我们来看C#实现的网络硬盘。
asp,asp.net,php,jsp下的301转向代码
在ASP.NET环境中,可以使用C#编写如下代码:```csharp<%@ Page Language="C#" %><script runat="server">protected void Page_Load
PHP中调用ASP.NET的WebService的代码
本文主要介绍了如何在PHP中调用ASP.NET编写的WebService。首先,创建一个C#的ASP.NET WebService,使用Visual Studio 2008的向导生成一个简单的服务,
一个完全免费的WEB打印插件控件,支持:C#/vb.net/asp/PHP/JSP,也有实例
这个插件控件兼容多种编程语言,如C#、VB.NET、ASP、PHP和JSP,这意味着无论你的后端技术栈是基于.NET Framework(如ASP.NET)还是开源的PHP或Java(如JSP),你都能无缝集成这个插件
asp、php、asp.net、jsp等主流网站开发语言比较
ASP.NET:微软开发的新一代开发语言ASP.NET 是微软开发的一种新一代开发语言,它借鉴了 Java 技术的优点,使用 C Sharp (C#) 语言作为 ASP.NET 的推荐语言,同时改进了以前


基础编程
