一 基本类型

int , flaoat , string , bool , DateTime

先给代码
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;

/// <summary>
/// SimpleWebService 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class SimpleWebService : System.Web.Services.WebService
{
    public SimpleWebService()
    {

    }

    [WebMethod]
    public void JustForTest(int a, float b, string c, bool d, DateTime e)
    {

    }
}

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function callService(num1, num2, num3, num4, num5)
        {
            var num1 = 123;
            var num2 = 123.456;
            var num3 = "你好";
            var num4 = true;
            var num5 = new Date();    
            SimpleWebService.JustForTest(num1, num2, num3, num4, num5);
        }
    </script>
</head>
<body>
    <form >

相关文章:

  • 2022-12-23
  • 2021-08-10
  • 2021-06-14
  • 2021-12-30
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-03
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2023-03-14
  • 2021-10-29
  • 2021-12-04
相关资源
相似解决方案