ASP.net通过http调用验证码短信接口源码

通过验证码短信http调用接口,,您可以很快速的在网站或者app中集成手机号验证功能,该源码只是核心代码,具体可以根据您的实际需求进行扩展。

该DEMO是ASP.net通过http调用验证码短信接口源码;

using System;using System.ComponentModel;using System.Diagnostics;using System.Web.Services;using System.Web.Services.Protocols;using System.Xml.Serialization;/// <remarks/>[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")][System.Diagnostics.DebuggerStepThroughAttribute()][System.ComponentModel.DesignerCategoryAttribute("code")][System.Web.Services.WebServiceBindingAttribute(Name = "smsSoap", Namespace = "")]public partial class sms : System.Web.Services.Protocols.SoapHttpClientProtocol{private System.Threading.SendOrPostCallback SubmitOperationCompleted;/// <remarks/>public sms(){this.Url = "?smsService";}/// <remarks/>public event SubmitCompletedEventHandler SubmitCompleted;/// <remarks/>[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "", ResponseNamespace = "", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]public SubmitResult Submit(string account, string password, string mobile, string content){object[] results = this.Invoke("Submit", new object[] {account,password,mobile,content});return ((SubmitResult)(results[0]));}/// <remarks/>public System.IAsyncResult BeginSubmit(string account, string password, string mobile, string content, System.AsyncCallback callback, object asyncState){return this.BeginInvoke("Submit", new object[] {account,password,mobile,content}, callback, asyncState);}/// <remarks/>public SubmitResult EndSubmit(System.IAsyncResult asyncResult){object[] results = this.EndInvoke(asyncResult);return ((SubmitResult)(results[0]));}/// <remarks/>public void SubmitAsync(string account, string password, string mobile, string content){this.SubmitAsync(account, password, mobile, content, null);}/// <remarks/>public void SubmitAsync(string account, string password, string mobile, string content, object userState){if ((this.SubmitOperationCompleted == null)){this.SubmitOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubmitOperationCompleted);}this.InvokeAsync("Submit", new object[] {account,password,mobile,content}, this.SubmitOperationCompleted, userState);}private void OnSubmitOperationCompleted(object arg){if ((this.SubmitCompleted != null)){System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));this.SubmitCompleted(this, new SubmitCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));}}/// <remarks/>public new void CancelAsync(object userState){base.CancelAsync(userState);}}/// <remarks/>[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")][System.SerializableAttribute()][System.Diagnostics.DebuggerStepThroughAttribute()][System.ComponentModel.DesignerCategoryAttribute("code")][System.Xml.Serialization.XmlTypeAttribute(Namespace = "")]public partial class SubmitResult{private int codeField;private string msgField;private int smsidField;/// <remarks/>public int code{get{return this.codeField;}set{this.codeField = value;}}/// <remarks/>public string msg{get{return this.msgField;}set{this.msgField = value;}}/// <remarks/>public int smsid{get{return this.smsidField;}set{this.smsidField = value;}}}/// <remarks/>[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")]public delegate void SubmitCompletedEventHandler(object sender, SubmitCompletedEventArgs e);/// <remarks/>[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")][System.Diagnostics.DebuggerStepThroughAttribute()][System.ComponentModel.DesignerCategoryAttribute("code")]public partial class SubmitCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs{private object[] results;internal SubmitCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :base(exception, cancelled, userState){this.results = results;}/// <remarks/>public SubmitResult Result{get{this.RaiseExceptionIfNecessary();return ((SubmitResult)(this.results[0]));}}}自助申请帐户地址:

太过于近,彼此身上隐性的刺又会深深的伤害对方。

ASP.net通过http调用验证码短信接口源码

相关文章:

你感兴趣的文章:

标签云: