首页产品库评测行情新闻|手机数码笔记本台式机DIY硬件数字家庭数码相机办公外设|软件下载游戏开发|社区

更多

数码相机
MP4
LCD
机箱
音箱

软件资讯设计 工具 系统 开发 安全 办公 陶吧 IT教育 Vista频道 | 下载中心酷我音乐盒 腾讯QQ
天极网 > 开发频道>化零为整WCF(5)-宿主Hosting

化零为整WCF(5)-宿主Hosting

2008-05-25 07:00作者:webabcd出处:天极网责任编辑:nancy

  介绍

  WCF(Windows Communication Foundation) - 宿主(Hosting):WCF服务可以宿主在IIS, Application, WAS, WindowsService。本文以宿主在WindowsService为例。

  示例

  1、服务

  IHello.cs

 


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

  Hello.cs


  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  using System.ServiceModel;
  
  namespace WCF.ServiceLib.Sample
  {
   /**//// 
   /// Hello类
   /// 
   public class Hello : IHello
   {
   /**//// 
   /// 打招呼方法
   /// 
   /// 人名
   /// 
   public string SayHello(string name)
   {
   return "Hello: " + name;
   }
   }
  }

关注此文的读者还看过:

返回开发频道首页

共3页。 123下一页

软件频道最新更新

热点推荐

IT嘉年华

编辑推荐

软件下载

热门
推荐

网友关注

软件
资料
游戏

装机推荐

文章排行

本周
本月
最新更新
天极服务|关于我们|About us|网站律师|RSS订阅|友情合作|加入我们|天极动态|网站地图|意见反馈|MSN/QQ上看天极
Copyright (C) 1999-2012 Yesky.com, All Rights Reserved 版权所有 天极网络