如何在c#中编写一个aspx web服务,就像这个php web服务一样

时间:2016-08-14 20:32:26

标签: c# android web-services

我已经编写了这个从Web应用程序接收数据的php Web服务, 但现在我想将Android应用程序中的数据发送到用C#aspx编写的Web服务 谁可以将这个PHP代码转换为aspx并非常感谢任何帮助

<?php

$data = array("result" => 0, "message" => "Error!");

if ($_SERVER['REQUEST_METHOD'] == "POST") {

        $user_name = $_POST['user_name'];
        $user_pass = $_POST['user_pass'];

        // check account 

} else
$data = array("hasAccount" => false, "userType" => "","account_status"=>0);

/* Output header */


header('Content-type: application/json');
echo json_encode($data);
?>

1 个答案:

答案 0 :(得分:0)

在C#中创建Web服务的步骤:

1.)创建新项目

enter image description here

2)。 enter image description here

3。)

enter image description here

4。)

enter image description here

5。)

enter image description here

祝你好运..