天使半只翼

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年6月5日

摘要: C#建立Web Service 1.在wwwroot目录下建立一个叫做Webservice的目录。 2.建立下面这样一个文件:using System; using System.Web.Services; public class AddNumbers : WebService { [WebMethod] public int Add(int a, int b) { int sum; sum = a + b; return sum; } } 3.将这个文件保存为AddService.asmx(a... 阅读全文
posted @ 2012-06-05 16:52 天使半只翼 阅读(337) 评论(0) 推荐(0) 编辑

摘要: 下面,我们将用C#建立一个名为“SecurityWebService”的Web Service。一个Web Service文件将含有形式为.asmx的扩展名。(就像Asp.net的文件扩展名为.aspx)<%@ WebService Language="C#" class="SecurityWebService" %> <%@ WebService Language="C#" class="SecurityWebService" %> 这条语句将告诉编译器程序将运行在Web Service模 阅读全文
posted @ 2012-06-05 16:41 天使半只翼 阅读(426) 评论(0) 推荐(0) 编辑

摘要: 在webServices项目的Web.config的<system.web>里加上:<webServices> <protocols> <add name="HttpPost" /> <add name="HttpGet" /> </protocols></webServices>[WebMethod(Description="This method call will get the company name and the price for a given 阅读全文
posted @ 2012-06-05 16:37 天使半只翼 阅读(406) 评论(0) 推荐(0) 编辑