Partial Class _Default Inherits System.Web.UI.Page Dim obj, obj1 Dim param() As String Private Sub Init() obj = CreateObject("WinHttp.WinHttpRequest.5.1") If obj Is Nothing Then obj = CreateObject("WinHttp.WinHttpRequest") End If If obj Is Nothing Then obj = CreateObject("MSXML2.ServerXMLHTTP") End If If obj Is Nothing Then obj = CreateObject("Microsoft.XMLHTTP") End If End Sub Public Function neerajSendSMS(ByVal smssendto As String, ByVal msg As String) As Boolean Init() Dim PostData, ActionToken As String Dim smsusername, smspassword As String '-------------------------------------------------------------------- 'PostData = "url=" & Request.ServerVariables("HTTP_REFERER") 'obj.Open "POST", "http://services.iperfect.net/way2sms/autologin.asp", False ' obj.Open("POST", "http://services.iperfect.net/way2sms/testwebsitedll.php", False) 'obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") 'obj.send(PostData) neerajSendSMS = neerajAutoLogin(smsusername, smspassword, smssendto, msg, ActionToken) Exit Function If obj.Status = 200 Then param = Split(obj.ResponseText, " ") ActionToken = param(0) smsusername = param(1) smspassword = param(2) 'Exit Function If InStr(obj.ResponseText, "False") Then ' MsgBox("You are not athorized to use this dll file please contact Neeraj on +917709979466", vbExclamation, "Neeraj Dhekale") neerajSendSMS = False Else neerajSendSMS = neerajAutoLogin(smsusername, smspassword, smssendto, msg, ActionToken) End If Else neerajSendSMS = False End If End Function Private Function neerajAutoLogin(ByVal smsusername As String, ByVal smspassword As String, ByVal smssendto As String, ByVal msg As String, ByVal ActionToken As String) As Boolean Dim PostData, smsflagConnectionTestTime As String Dim str, uniqueid As String 'ActionToken = "dsf45asvd5" PostData = "MobileNoLogin=" & smsusername & "&LoginPassword=" & smspassword & "&x=38&y=8&redirect=" 'obj.Open "POST", "http://services.iperfect.net/way2sms/autologin.asp", False 'obj.Open("POST", "http://www.fullonsms.com/login.php", False) 'obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") 'obj.send(PostData) neerajAutoLogin = neerajActualSMSSend(smssendto, msg, ActionToken, uniqueid) exit Function If obj.Status = 200 Then str = obj.responseText uniqueid = Trim(Mid(str, InStr(str, searchpattern.InnerHtml) + 31, 37)) searchpattern.InnerHtml = uniqueid.ToString() neerajAutoLogin = neerajActualSMSSend(smssendto, msg, ActionToken, uniqueid) Else neerajAutoLogin = False End If End Function Private Function neerajActualSMSSend(ByVal smssendto As String, ByVal msg As String, ByVal ActionToken As String,uniqueid As String) As Boolean Dim PostData As String 'PostData = "HiddenAction=instantsms&catnamedis=Birthday&Action=" & ActionToken & "&chkall=1&chknone=0&chktoggle=0&textfield2=+91&MobNo=" & smssendto & "&txtLen=140&textArea=" & msg & "&gchk=&fbcb=" 'PostData = "HiddenAction=instantsms&catnamedis=Birthday&expensive=" & ActionToken & "&embassy=" & uniqueid & "&chkall=on&MobNo=" & smssendto & "&textArea=" & Replace(msg, " ", "+") ' PostData = "ActionScript=%2Fhome.php&CancelScript=%2Fhome.php&HtmlTemplate=%2Fvar%2Fwww%2Fhtml%2Ffullonsms%2FStaticSpamWarning.html&MessageLength=140&MobileNos=" & smssendto & "&Message=" & Replace(msg, " ", "+") & "&SelTpl=defaultId&Gender=0&FriendName=Your+Friend+Name&ETemplatesId=&TabValue=contacts" PostData = Replace(PostData, vbCrLf, "") obj.Open("POST", "http://full2sms.net/API/WebSMS/Http/v1.0a/index.php?username=neeraj&password=neeraj9362&sender=WEBSMS&to=" & smssendto & "&message=" & Replace(msg, " ", "+"), False) obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") obj.send(PostData) If obj.Status = 200 Then neerajActualSMSSend = True Else neerajActualSMSSend = True End If End Function Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim flg As Boolean If Not Request.QueryString("mobileno") = "" Then If Request.QueryString("mobileno") = "" Or Request.QueryString("message") = "" Then If Not Request.QueryString("redirectUrl") = "" Then Response.Redirect(Request.QueryString("redirectUrl") & "?status=Invalid+Input!!!") Else lblStatus.Text = "SMS Sending failed" End If Exit Sub End If flg = neerajSendSMS(Request.QueryString("mobileno"), CStr(Replace(Request.QueryString("message"), "+", " "))) If flg = True Then If Request.QueryString("redirectUrl") = "" Then lblStatus.Text = "SMS Sent!!" Else 'Request.QueryString.Item("status") = "SMS Sent!!" 'status.Value = "SMS Sent!!!" Response.Redirect(Request.QueryString("redirectUrl") & "?status=SMS+Sent!!!") 'Server.Transfer(Request.QueryString("redirectUrl")) End If Exit Sub Else lblStatus.Text = "SMS Sending failed" End If Else If Request.Form("mobileno") = "" Or Request.Form("message") = "" Then If Not Request.Form("redirectUrl") = "" Then Response.Redirect(Request.Form("redirectUrl") & "?status=Invalid+Input!!!") Else lblStatus.Text = "SMS Sending failed" End If Exit Sub End If flg = neerajSendSMS(Request.Form("mobileno"), Request.Form("message")) If flg = True Then If Request.Form("redirectUrl") = "" Then lblStatus.Text = "SMS Sent!!" Else 'Request.Form.Item("status") = "SMS Sent!!" 'status.Value = "SMS Sent!!!" Response.Redirect(Request.Form("redirectUrl") & "?status=SMS+Sent!!!") 'Server.Transfer(Request.Form("redirectUrl")) End If Exit Sub Else lblStatus.Text = "SMS Sending failed" End If End If lblStatus.Text = Request.ServerVariables("HTTP_REFERER") & "SMS Will not send. You are not authorized person to use this service" End Sub End Class