-
Nov 9th, 2020, 07:30 AM
#1
Thread Starter
New Member
VB timeout and resume work?
Option Explicit
Dim A2, A1, s, f1, ts, ts1, fso, fso1, Soobshenie, SiteAddr1, SiteAddr2, bs, cur_time, api_key, api_secret, Message, HTTPgetCrypted
Const ForReading = 1
Const ForWriting = 2
Main
Sub Die()
End Sub
Sub Main
'NEXMO Credentials
api_key = ""
api_secret = ""
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("nexmonumbers.txt", ForReading)
SiteAddr1 = "https://rest.nexmo.com/sms/json?api_key="&api_key&"&api_secret="&api_secret&"&from=12012857494&to="
SiteAddr2 = "&type=unicode&text="
Message = "sms text"
Do While Not ts.AtEndOfStream
s = ts.ReadLine
HTTPgetCrypted = SiteAddr1 & s & SiteAddr2 & Message
A1 = ""
A1 = HTTPGetSend(HTTPGetCrypted)
cur_time = time & " --- " & date
Set fso1 = CreateObject("Scripting.FileSystemObject")
Set ts1 = fso1.OpenTextFile("nexmoresult.txt", 8, True)
ts1.WriteLine(cur_time)
ts1.WriteLine("--------------------------------------------------------------------------------------")
ts1.WriteLine(A1)
ts1.Close
Set fso1 = Nothing
Set ts1 = Nothing
Loop
ts.Close
MsgBox "SMS sending complete, please see nexmoresult.txt for log"
WScript.Quit()
End Sub
Function HTTPGetSend(ByVal URLGet)
Dim oHTTP
Set oHTTP = CreateObject("MSXML2.XMLHTTP")
oHTTP.Open "GET",URLGet,False
oHTTP.Send
HTTPGetSend = oHTTP.responseText
Set oHTTP = Nothing
End Function
Hello guys,i have this nexmo sms sender, how i can write this code for a delay between sms's ! Nexmo api support 1 sms per second but this script run to fast ) . Exemple : put the numbers and start the script ,send first sms pause one second ,send 2nd sms pause another second..
-
Nov 9th, 2020, 08:32 AM
#2
Re: VB timeout and resume work?
Use a sleep call in your loop.
-tg
addendum - also when posting code, put it in [code][/code] or [highlight=X][/highlight] tags (where X is the name of the language) to preserve the formatting and to make it easier to read.
-
Nov 9th, 2020, 09:17 AM
#3
Thread Starter
New Member
Re: VB timeout and resume work?
I don't know how
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|