自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

開發(fā)人員對WCF編程理解講述

開發(fā) 后端
WCF編程有很多值得學習的地方,這里我們主要介紹WCF編程,包括介紹WCF編程等方面。在向大家詳細介紹WCF編程之前,首先讓大家了解下WCF編程。

在后臺運行WCF編程應(yīng)用程序。出現(xiàn)提示后,單擊OK按鈕激活Web.config中的調(diào)試功能。在控制臺應(yīng)用程序窗口中輸入一個數(shù)字,按下回車鍵,如下圖所示顯示一個簡單的WCF服務(wù)和客戶程序。

試試看:一個簡單的WCF服務(wù)和客戶程序#t#

(1) WCF編程:在目錄C:BegVCSharp\Chapter35下創(chuàng)建一個新的WCF服務(wù)應(yīng)用程序項目Ch35Ex01

(2)WCF編程: 在解決方案中添加一個控制臺應(yīng)用程序Ch35Ex01Client。

(3) WCF編程:在Build菜單上單擊Build Solution選項。

(4)WCF編程: 在Solution Explorer中右擊Ch35Ex01Client,選擇Add Service Reference選項。

(5)WCF編程; 在Add Service Reference對話框中,單擊Discover。

(6)WCF編程: 開始開發(fā)Web服務(wù)器,加載WCF服務(wù)的信息后,展開該引用,查看其細節(jié),如圖

35-2

(7) WCF編程:單擊OK按鈕,添加服務(wù)引用。

(8)WCF編程: 在Ch35Ex01Client應(yīng)用程序中修改Pragram.cs中的代碼,如下所示:

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using Ch35Ex01Client.ServiceReference1;  
  6. namespace Ch35Ex01Client  
  7. {  
  8. class Program  
  9. {  
  10. static void Main(string[] args)  
  11. {  
  12. string numericInput = null;  
  13. int intParam;  
  14. do  
  15. {  
  16. Console.WriteLine(  
  17. "Enter an integer and press enter to call the WCF service.");  
  18. numericInput = Console.ReadLine();  
  19. }  
  20. while (!int.TryParse(numericInput, out intParam));  
  21. Service1Client client = new Service1Client();  
  22. Console.WriteLine(client.GetData(intParam));  
  23. Console.WriteLine("Press an key to exit.");  
  24. Console.ReadKey();  
  25. }  
  26. }  

責任編輯:chenqingxiang 來源: 計世網(wǎng)
相關(guān)推薦

2021-02-19 09:33:01

kubernetesJAVA服務(wù)

2012-07-12 00:09:34

2020-08-14 08:11:17

編程語言PythonIT

2017-11-01 15:03:37

超級計算機編程

2009-12-25 10:11:22

.NET Framew

2023-10-13 18:10:14

編程語言Rust

2010-02-02 16:07:17

Python開發(fā)人員

2012-02-15 09:17:02

Python編程

2012-05-30 15:15:42

ibmdw

2023-03-15 07:12:53

企業(yè)開發(fā)人員提供商

2020-05-11 10:25:38

編程語言J開發(fā)Python

2009-12-11 14:50:14

Visual Basi

2009-11-23 20:07:51

ibmdw開發(fā)

2023-08-30 08:01:37

前端CSS

2020-01-16 15:40:19

編程語言PythonJava

2017-04-12 09:24:45

開發(fā)編程Java

2013-05-24 13:36:32

開發(fā)人員開發(fā)編程

2009-05-31 08:31:07

GoogleWaveTechCrunch

2011-09-05 14:21:29

webOS

2023-08-14 15:23:37

點贊
收藏

51CTO技術(shù)棧公眾號