<%@ WebService Language="c#" Codebehind="Service1.asmx.cs" Class="WebApplication5.Service1" %>
解决方案 »
- 系统的操作日志记录应如何实现?
- c#开发辅助.遇到点问题.貌似是JsonObjectModel
- 请教C#WinForm下的UDP代码(服务器和客户端)
- 数据库还原问题
- Mailmessage+smtpclient发送电子邮件时密码写在哪里?
- 求教!!!!C#中,在读取文件时,用ReadLine一行一行读文件里内容时。。。。
- C#中调用脚本语言遇到的问题(急,请您指教)
- 求助asp.net(ext js)例子 可以运行的
- C#代码编译时的奇妙问题求解
- 征求各位学JAVA与学C#哪个好学些呢?
- 有关泛型Dictionray作为参数传递
- [总结与提问]关于Crystal Report连接动态生成的dataset的方法的总结和一些新问题(谢谢cancan)
orhttp://samples.gotdotnet.com/quickstart/util/srcview.aspx?path=/quickstart/aspplus/samples/services/DataTypes/DataTypes.src
下面提供一段示例代码供您参考:
Service1.asmx代码:
<%@ WebService Language="c#" Codebehind="Service1.asmx.cs" Class="WebService1.Service1" %>Service1.asmx.cs代码:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;namespace WebService1
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
} #region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
} /// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion // WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5 [WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
} — 微软全球技术中心 VB支持中心本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。