av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

WCF服務(wù)啟動(dòng)特殊方法分享

對(duì)于WCF服務(wù)啟動(dòng)的方法,我們可以通過多種方式來實(shí)現(xiàn)。在這里我們將會(huì)通過一種特殊的方法來實(shí)現(xiàn)WCF服務(wù)啟動(dòng)。大家首先可以通過一段代碼示例來詳細(xì)分析一下這一服務(wù)的啟動(dòng)方法,以此加深這方面的印象。

專注于為中小企業(yè)提供網(wǎng)站制作、成都網(wǎng)站制作服務(wù),電腦端+手機(jī)端+微信端的三站合一,更高效的管理,為中小企業(yè)隴縣免費(fèi)做網(wǎng)站提供優(yōu)質(zhì)的服務(wù)。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動(dòng)了上千多家企業(yè)的穩(wěn)健成長(zhǎng),幫助中小企業(yè)通過網(wǎng)站建設(shè)實(shí)現(xiàn)規(guī)模擴(kuò)充和轉(zhuǎn)變。

WCF服務(wù)啟動(dòng)代碼示例:

 
 
 
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.ServiceModel;  
  6. using System.ServiceModel.Description;  
  7. namespace WCF1  
  8. {  
  9. [ServiceContract(Name = "MyService", Namespace = 
    "http://www.huisoftware.com")]  
  10. public class MyService  
  11. {  
  12. [OperationContract]  
  13. public string MyMethod(string str)  
  14. {  
  15. return str + "Server Hello World";  
  16. }  
  17. }  
  18. class Program  
  19. {  
  20. static void Main(string[] args)  
  21. {  
  22. using (ServiceHost host = new ServiceHost(typeof(MyService)))  
  23. {  
  24. host.AddServiceEndpoint(typeof(MyService), new WSHttpBinding(), 
    "http://127.0.0.1:8080/MyService");  
  25. if (host.Description.Behaviors.Find() == null)  
  26. {  
  27. ServiceMetadataBehavior behavior = new ServiceMetadataBehavior();  
  28. behavior.HttpGetEnabled = true;  
  29. behavior.HttpGetUrl = new Uri("http://127.0.0.1:8080
    /MyService/metadata");  
  30. host.Description.Behaviors.Add(behavior);  
  31. }  
  32. host.Opened += delegate  
  33. {  
  34. Console.WriteLine("WCF服務(wù)已經(jīng)啟動(dòng)");  
  35. };  
  36. host.Open();  
  37. Console.Read();  
  38. }  
  39. }  
  40. }  

WCF服務(wù)啟動(dòng)的相關(guān)代碼就為大家介紹到這里。

【編輯推薦】

  1. WCF依賴屬性具體概念詳解
  2. WCF跨域具體問題解析
  3. WCF消息交換應(yīng)用方式技巧分享
  4. WCF會(huì)話狀態(tài)功能特點(diǎn)解析
  5. WCF綁定元素具體應(yīng)用知識(shí)介紹

網(wǎng)頁題目:WCF服務(wù)啟動(dòng)特殊方法分享
標(biāo)題路徑:http://uogjgqi.cn/article/coecccg.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營(yíng)咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流