日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

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

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
WCF獲取客戶端IP正確代碼操作剖析

WCF應(yīng)用方法比較靈活,可以為開發(fā)人員創(chuàng)造一個跨平臺的解決方案。我們在這里會為大家詳細講解一下有關(guān)WCF獲取客戶端IP的操作方法,希望對這方面又需要的朋友們可以從中獲得一些幫助。

創(chuàng)新互聯(lián)主要從事成都網(wǎng)站制作、網(wǎng)站設(shè)計、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)奎文,10年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):028-86922220

WCF獲取客戶端IP的簡單方法:

 
 
 
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;using System.Runtime.Serialization;
  4. using System.ServiceModel;
  5. using System.Text;
  6. using System.ServiceModel.Channels;
  7. namespace ClientInfoSample
  8. {
  9. public class MyService : IService
  10. {
  11. public string GetData(string value)
  12. {
  13. OperationContext context = OperationContext.Current;
  14. MessageProperties messageProperties = context.IncomingMessageProperties;
  15. RemoteEndpointMessageProperty endpointProperty =
  16. messageProperties[RemoteEndpointMessageProperty.Name]
  17. as RemoteEndpointMessageProperty; 
  18. return string.Format("Hello {0}! Your IP address is {1} and your port is {2}",
  19. value, endpointProperty.Address, endpointProperty.Port);
  20. }
  21. }
  22. }
  23. using System;
  24. using System.Collections.Generic;
  25. using System.Linq;
  26. using System.Runtime.Serialization;
  27. using System.ServiceModel;
  28. using System.Text;
  29. namespace ClientInfoSample
  30. {
  31. [ServiceContract]
  32. public interface IService
  33. {
  34. [OperationContract]
  35. string GetData(string value);
  36. }
  37. }

網(wǎng)站標(biāo)題:WCF獲取客戶端IP正確代碼操作剖析
鏈接URL:http://www.5511xx.com/article/coosgog.html