-
January 29th, 2012, 03:16 AM
#1
Send Items in Listbox AT Commands
I wanted to send the items within a listbox.One item at a time
this is the code snippet:
For i = 0 To 5
SMSPort.Write("AT+CMGS=" & Chr(34) & sender & Chr(34) & vbCrLf)
SMSPort.Write(listfiles.Items(i).ToString() & vbCr & Chr(26))
System.Threading.Thread.Sleep(800)
Next
And I tried this:
SMSPort.Write("AT+CMGS=" & Chr(34) & sender & Chr(34) & vbCrLf)
SMSPort.Write(Textbox1.text & vbCr & Chr(26))
System.Threading.Thread.Sleep(800)
Both listbox and textbox don't allow me to send sms.
There's no error but there are no outputs also. I cannot send any txt messages. However I tried this to test my code.
For i = 0 To 5
SMSPort.Write("AT+CMGS=" & Chr(34) & sender & Chr(34) & vbCrLf)
SMSPort.Write(i+1 & vbCr & Chr(26))
System.Threading.Thread.Sleep(800)
Next
And so I received 5 text messages with outputs: 1 to 5.
For i = 0 To 5
SMSPort.Write("AT+CMGS=" & Chr(34) & sender & Chr(34) & vbCrLf)
SMSPort.Write("arra" & vbCr & Chr(26))
System.Threading.Thread.Sleep(800)
Next
I received 5 SMS with "arra".
Kindly help me with my problem. I can't figure out what's wrong with my code.
-
January 29th, 2012, 03:41 AM
#2
Re: Send Items in Listbox AT Commands
What is the value of the variable in your Listbox or textbox content? Have you tryed it with the values that worked when hard coded?
I am not sure how well sleep would work in such a case. I would think it may interupt the write to the port?
Always use [code][/code] tags when posting code.
-
January 29th, 2012, 06:55 AM
#3
Re: Send Items in Listbox AT Commands
Originally Posted by DataMiser
What is the value of the variable in your Listbox or textbox content? Have you tryed it with the values that worked when hard coded?
I am not sure how well sleep would work in such a case. I would think it may interupt the write to the port?
Hi.
actually I tried sending the contents of any txtbox from my form with contents
"Hi!, My name is arra"
"123456"
I received the messages successfully. But for a textbox with a content of a path : for example: "F:\ARTWORKS\Misc\Arra.jpg"
no errors.but doesn't send a message. it's so frustrating. I've tried cutting the string to "ARTWORKS\Misc\Arra.jpg", but still no success but if other formats, a word a sentence ,it can send an SMS. it's so weird
-
January 29th, 2012, 07:31 AM
#4
Re: Send Items in Listbox AT Commands
Originally Posted by DataMiser
What is the value of the variable in your Listbox or textbox content? Have you tryed it with the values that worked when hard coded?
I am not sure how well sleep would work in such a case. I would think it may interupt the write to the port?
Hi again DataMiser.
After experimenting a lot of strings. I've come to the conclusion that the symbol "\" backslash prevents me from sending an SMS. When I changed all the backlashes with a "/" symbol. "F:/ARTWORKS/Misc/Arra.jpg", it surprisingly send the text message. it's so upsetting though, because it's not the right symbol for a path.
-
January 29th, 2012, 02:07 PM
#5
Re: Send Items in Listbox AT Commands
Try sending TWO of them instead of one. Or, Include in double-quotes
Maybe even the Drive Letter!
Tags for this Thread
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
|