在asp.net项目中使用服务页面有什么好处 [英] what are the benefits of using service pages in asp.net projects
本文介绍了在asp.net项目中使用服务页面有什么好处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在asp.net项目中使用服务页面有什么好处
what are the benefits of using service pages in asp.net projects
using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using BusinessLogic.BLL;
using System.Text.RegularExpressions;
using DataAccess.DL;
using System.Collections.Generic;
using System.Web.Script.Services;
using System.Data;
namespace TravelAgency.Services
{
/// <summary>
/// Summary description for User
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class User : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod(EnableSession = true)]
public string RegisterUser(string Title, string First_Name, string Last_Name, string Email, string Ref_No, DateTime ADate, string ATime, DateTime DDate, string DTime, int N_F_Nights, string Room_Type, int N_F_Rooms, int N_F_Adults, int N_F_Child, string Booking_Terms, float Amount)
{
BLLRegister objBLL = new BLLRegister();
DLRegister objDL = new DLRegister();
string res = "";
objDL.TA_Title = Title.ToString().Trim();
objDL.TA_Fname = First_Name.ToString().Trim();
objDL.TA_Lname = Last_Name.ToString().Trim();
objDL.TA_Email = Email.Trim();
objDL.TA_BookingRefNo = Ref_No.ToString().Trim();
objDL.TA_ArrivalDate = Convert.ToDateTime(ADate);
objDL.TA_DepDate = Convert.ToDateTime(DDate);
objDL.TA_Nights = Convert.ToInt32(N_F_Nights);
objDL.TA_RoomType = Room_Type.ToString().Trim();
objDL.TA_Rooms = Convert.ToInt32(N_F_Rooms);
objDL.TA_Adults = Convert.ToInt32(N_F_Adults);
objDL.TA_Child = Convert.ToInt32(N_F_Child);
objDL.TA_BookingTerms = Booking_Terms.ToString().Trim();
objDL.TA_AmountDue = Convert.ToInt32(Amount);
if (objBLL.RegisterUser(objDL))
{
res = "Success";
}
else
{
res = "Failed";
}
return res;
}
}
}
推荐答案
网络服务+ asp.net +优势 [ ^ ]。
Web服务 [ ^ ]
Web service[^]
来自wiki:
Web服务是一个万维网上两个电子设备之间的通信方法。它是在网络上的网络地址提供的软件功能,其服务始终如实用计算的概念所示。
A Web service is a method of communications between two electronic devices over the World Wide Web. It is a software function provided at a network address over the web with the service always on as in the concept of utility computing.
Google for more。
Google for more.
这篇关于在asp.net项目中使用服务页面有什么好处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文