發布時間:2020-08-07 05:06 作者:獨孤劍 閱讀:2786
ASP.NET asmx獲取客戶端ip, 請求ip, WebService中如何獲取客戶端的ip
this.Context.Request.UserHostAddress.ToString();
using System.Web.Services; namespace WeChatPortal.WebService { /// <summary> /// Summary description for WebService1 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] public class WebService1 : System.Web.Services.WebService { [WebMethod] public string HelloWorld() { return this.Context.Request.UserHostAddress.ToString(); } } }
微信打賞, 微信掃一掃
支付寶打賞, 支付寶掃一掃
如果文章對您有幫助,歡迎給作者打賞