Question sending SMS with new pin code

guysoul

Member
Joined
Jun 29, 2011
Messages
5
Location
Halden, Norway
Programming Experience
3-5
Hi guys,

Im new to vb.net and and Im currently developing an application that will send sms with the new auto generated pin code to the customer. My sms app used to work but now, it just stopped all of the sudden. Im not sure what I did but here is my script below. Can someone check on this please..

Private Sub GenCodeAndSendSMS(ByVal tmpGSMNo As String, ByVal tmpText As String, ByVal tmpID As Long)
'Generate the code. 4 digits (ranging from 0 - 9999) + minute + current year
Dim nsms As New SMSWS.TDSSMSService
Dim tempError As String = ""

Dim str As String = tmpText
Dim str2 As String = str.Replace("TDS SR", "")

'declaration of variables for autogencode using datetime
Dim randomvalue As New Random
Dim randomhold As Integer
Dim newcode As Long

For i As Integer = 0 To 9999
randomhold = randomvalue.Next(1, 9999)
newcode = randomhold & DateTime.Now.Minute & DateTime.Now.Year


Next

Console.WriteLine(str2)
tmpText = dec2baseN(str2, 16) & newcode


'Send the SMS with the new code
Try
WriteLog("Sender SMS til" & tmpGSMNo & "Melding: " & tmpText)




Dim SMSstat As Boolean = nsms.SendSMSAndCharge(tmpGSMNo, tmpText, "", "", "SMSNotify", tempError)


If SMSstat = False Then
WriteLog("Sending av SMS feilet med feilmelding: " & tempError)
Else
WriteLog("Sending av SMS OK.")
End If


Catch ex As Exception
WriteLog("Sending av SMS feilet med feilkode" & ex.Message)
End Try

UpdateSMS(tmpID)






End Sub



I tried to debug my script and it shows on the logs the that the code has been sent successfully but I didnt get any message on my mobile. I checked the connection settings on my sms app, it was all okay.. no error message or something.. I really need help for guys.. This is for my masteral thesis.. :( been trying to resolve this for 2 weeks now.. Last option is to send a message here..
 
Last edited:
Back
Top