Welcome

首页 / 软件开发 / WCF / WCF示例(1) - 不能免俗,我也从Hello开始

WCF示例(1) - 不能免俗,我也从Hello开始2012-01-20 webabcd 介绍

WCF(Windows Communication Foundation) - 废话不多说,俗也不能免,我也从Hello开始

示例

1、服务

IHello.cs

using System;using System.Collections.Generic;using System.Linq;using System.Text;  using System.ServiceModel;  namespace WCF.ServiceLib.Sample{  /**//// <summary>  /// IHello接口  /// </summary>  [ServiceContract]  public interface IHello  {    /**//// <summary>    /// 打招呼方法    /// </summary>    /// <param name="name">人名</param>    /// <returns></returns>    [OperationContract]    string SayHello(string name);  }}