日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
開(kāi)發(fā)人員對(duì)WCF編程理解講述

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

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

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

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

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

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

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

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

(7) WCF編程:?jiǎn)螕鬙K按鈕,添加服務(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. }  


名稱欄目:開(kāi)發(fā)人員對(duì)WCF編程理解講述
本文網(wǎng)址:http://www.dlmjj.cn/article/dpjodds.html