|
-
May 30th, 2012, 09:14 AM
#121
Hyperactive Member
Re: sending sms with listview and checkbox in listview
did u load the numbers in listbox ?
-
May 30th, 2012, 09:16 AM
#122
Thread Starter
Enjoy the moment
Re: sending sms with listview and checkbox in listview
yes i did name and number
-
May 30th, 2012, 09:16 AM
#123
Hyperactive Member
Re: sending sms with listview and checkbox in listview
snd me ur frm , with changes i told u
-
May 30th, 2012, 09:17 AM
#124
Thread Starter
Enjoy the moment
Re: sending sms with listview and checkbox in listview
Code:
Private Sub btnsend_Click()
Dim args
Set winObj = CreateObject("WinHttp.WinHttpRequest.5.1")
Call winObj.Open("POST", "https://cellactpro.net/GlobalSms/ExternalClient/GlobalAPI.asp", False)
winObj.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
winObj.setRequestHeader "User-Agent", "Message Test"
winObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Build the XML for sending
lsXml = "<PALO><HEAD><FROM>ammishov</FROM><APP USER=""*****"" PASSWORD=""*****""/><CMD>sendtextmt</CMD></HEAD>"
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>" & List1.Index & "</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
lsXml = lsXml & "<OPTIONAL><CALLBACK> " & Text3 & "</CALLBACK></OPTIONAL></PALO>"
'wscript.echo lsXml
lsXml = ReplaceData(lsXml)
SendString = "XMLString=" & lsXml
winObj.send (SendString)
result = winObj.responseText
Text1.Text = ""
Text3.Text = ""
End Sub
'Replace Problematic Chars
Function ReplaceData(ByRef data)
data = Replace(data, "%", "%25")
data = Replace(data, " ", "%20")
data = Replace(data, "#", "%23")
data = Replace(data, "&", "%26")
data = Replace(data, "?", "%3F")
data = Replace(data, "+", "%2B")
data = Replace(data, "/n", "%0A")
ReplaceData = data
End Function
this is the send code
tell me what to put
Last edited by salsa31; Apr 4th, 2013 at 05:11 AM.
-
May 30th, 2012, 09:20 AM
#125
Hyperactive Member
Re: sending sms with listview and checkbox in listview
Private Sub btnsend_Click()
Dim args
Set winObj = CreateObject("WinHttp.WinHttpRequest.5.1")
Call winObj.Open("POST", "https://cellactpro.net/GlobalSms/ExternalClient/GlobalAPI.asp", False)
winObj.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
winObj.setRequestHeader "User-Agent", "Message Test"
winObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Build the XML for sending
lsXml = "<PALO><HEAD><FROM>ammishov</FROM><APP USER=""*****"" PASSWORD=""*****""/><CMD>sendtextmt</CMD></HEAD>"
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>" & List1.Index & "</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
lsXml = lsXml & "<OPTIONAL><CALLBACK> " & liist1.text & "</CALLBACK></OPTIONAL></PALO>"
'wscript.echo lsXml
lsXml = ReplaceData(lsXml)
SendString = "XMLString=" & lsXml
winObj.send (SendString)
result = winObj.responseText
Text1.Text = ""
Text3.Text = ""
End Sub
'Replace Problematic Chars
Function ReplaceData(ByRef data)
data = Replace(data, "%", "%25")
data = Replace(data, " ", "%20")
data = Replace(data, "#", "%23")
data = Replace(data, "&", "%26")
data = Replace(data, "?", "%3F")
data = Replace(data, "+", "%2B")
data = Replace(data, "/n", "%0A")
ReplaceData = data
End Function
list1.listindex=list1.listindex + val(1)
now put this code in snd button and first ur listbox should be named list1 and should be loading the numbers , and before click send u have to select the first number, remove any code done on list1
-
May 30th, 2012, 09:26 AM
#126
Thread Starter
Enjoy the moment
Re: sending sms with listview and checkbox in listview
Object not an array
i get error
-
May 30th, 2012, 09:34 AM
#127
Re: sending sms with listview and checkbox in listview
 Originally Posted by salsa31
yes its sending
Ok. Then iterate through the ListView and for those items that are being check marked, enclose the number in that row with "<TO>" tag and append it to the XML.
Try testing the function that I have given you:
vb Code:
Private Function getSelectedNums() As String Dim temp As String temp = "" Dim i As Long For i = 1 To ListView1.ListItems.Count '~~~ Loop through the listview If ListView1.ListItems(i).Checked = True Then '~~~ if an item is checked temp = temp & "<TO>" & ListView1.ListItems(i).SubItems(1) & "</TO>" '~~~ enclose the number in "<TO>" tags End If Next getSelectedNums = temp '~~~ return it End Function
So, in place of this line in your code:
Code:
lsXml = lsXml & "<TO>" & Text2 & "</TO>"
replace that line with this:
Code:
lsXml = lsXml & getSelectedNums()
Test it and let us know if the issue still persists. Also, post the code that you have tried too.
Last edited by akhileshbc; May 30th, 2012 at 09:48 AM.
Reason: corrected typo in variable name "lsXML"
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 30th, 2012, 09:38 AM
#128
Hyperactive Member
Re: sending sms with listview and checkbox in listview
Private Sub btnsend_Click()
Dim args
Set winObj = CreateObject("WinHttp.WinHttpRequest.5.1")
Call winObj.Open("POST", "https://cellactpro.net/GlobalSms/ExternalClient/GlobalAPI.asp", False)
winObj.Option(WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
winObj.setRequestHeader "User-Agent", "Message Test"
winObj.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
'Build the XML for sending
lsXml = "<PALO><HEAD><FROM>ammishov</FROM><APP USER=""*****"" PASSWORD=""*****""/><CMD>sendtextmt</CMD></HEAD>"
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>" & List1.Index & "</TO>"
lsXml = lsXml & "</DEST_LIST></BODY>"
text3.text=list1.text
lsXml = lsXml & "<OPTIONAL><CALLBACK> " & text3 & "</CALLBACK></OPTIONAL></PALO>"
'wscript.echo lsXml
lsXml = ReplaceData(lsXml)
SendString = "XMLString=" & lsXml
winObj.send (SendString)
result = winObj.responseText
Text1.Text = ""
Text3.Text = ""
End Sub
'Replace Problematic Chars
Function ReplaceData(ByRef data)
data = Replace(data, "%", "%25")
data = Replace(data, " ", "%20")
data = Replace(data, "#", "%23")
data = Replace(data, "&", "%26")
data = Replace(data, "?", "%3F")
data = Replace(data, "+", "%2B")
data = Replace(data, "/n", "%0A")
ReplaceData = data
End Function
list1.listindex=list1.listindex + val(1)
try this
-
May 30th, 2012, 09:42 AM
#129
Thread Starter
Enjoy the moment
Re: sending sms with listview and checkbox in listview
it dosnt give me any error but also it dosnt send the sms
i replaced this sXml = lsXml & "<TO>" & Text2 & "</TO>"
with this
sXml = lsXml & "<TO>" & Text2 & "</TO>"
but not sending the sms from listview
-
May 30th, 2012, 09:43 AM
#130
Hyperactive Member
Re: sending sms with listview and checkbox in listview
-
May 30th, 2012, 09:47 AM
#131
Re: sending sms with listview and checkbox in listview
 Originally Posted by salsa31
it dosnt give me any error but also it dosnt send the sms
i replaced this sXml = lsXml & "<TO>" & Text2 & "</TO>"
with this
sXml = lsXml & "<TO>" & Text2 & "</TO>"
but not sending the sms from listview
Replace it with this:
Code:
lsXml = lsXml & getSelectedNums()
In my previous post, there was a typo. The variable name should be "lsXML" and I used "sXML". Please correct that.
You should also have the function code(from my previous post) copied to your form. What we are doing above is, calling that function. Which will return the selected items in ListView(the mobile number actually) enclosed within "<TO>" tags, as a String.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 30th, 2012, 10:17 AM
#132
Thread Starter
Enjoy the moment
Re: sending sms with listview and checkbox in listview
like this you meen
lsXml = lsXml & "<TO>" & getSelectedNums() & "</TO>" or like this? sXml = lsXml & "<TO>" & getSelectedNums() & "</TO>"
still dosnt work
dosnt send sms
i added a listbox
and who ever i want to send sms i transfer him to the listbox and send
can you tell me what to write for the listbox?
i meen to send sms to the customers that in the listbox?
Last edited by salsa31; May 30th, 2012 at 10:27 AM.
-
May 30th, 2012, 11:42 AM
#133
Re: sending sms with listview and checkbox in listview
 Originally Posted by salsa31
like this you meen
lsXml = lsXml & "<TO>" & getSelectedNums() & "</TO>" or like this? sXml = lsXml & "<TO>" & getSelectedNums() & "</TO>"
You still didn't get the idea ?
This is what we are trying to do:
Code:
....
<TO>mobile_number_1</TO>
<TO>mobile_number_2</TO>
<TO>mobile_number_3</TO>
<TO>mobile_number_4</TO>
...
So the function that I have posted generates a string like above with the mobile numbers of the selected items in ListView.
If you still didn't understand it, try adding a button and in it's click event, use the following line:
Code:
MsgBox getSelectedNums()
And see what is being displayed.
Last edited by akhileshbc; May 30th, 2012 at 12:24 PM.
Reason: typo
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 30th, 2012, 12:22 PM
#134
Thread Starter
Enjoy the moment
Re: sending sms with listview and checkbox in listview
 Originally Posted by akhileshbc
You still didn't get the idea ?
This is what we are trying to do:
Code:
....
<TO>mobile_number_1</TO>
<TO>mobile_number_2</TO>
<TO>mobile_number_3</TO>
<TO>mobile_number_4</TO>
...
So the function that I have posted generates a string like above with the mobile numbers of the selected items in ListView.
If you still didn't understand it, try adding a button and in it's click event, use the following line:
Code:
<TO>MsgBox getSelectedNums()
And see what is being displayed.

it show me the numbers from the listview but dosnt send any sms
Last edited by salsa31; May 30th, 2012 at 12:27 PM.
-
May 30th, 2012, 12:25 PM
#135
Re: sending sms with listview and checkbox in listview
Code:
'~~~ Testing
Private Sub Command1_Click()
MsgBox getSelectedNums()
End Sub
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 30th, 2012, 12:28 PM
#136
Thread Starter
Enjoy the moment
Re: sending sms with listview and checkbox in listview
<TO>number1</TO>number2</To> this is what i get
-
May 30th, 2012, 12:35 PM
#137
Re: sending sms with listview and checkbox in listview
Code:
<TO>number1</TO><TO>number2</To>
Isn't it ?
What we have to do is, put this returned string in your XML code.
So, in your code, we could use it like this:
Code:
'.....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & getSelectedNums()
lsXml = lsXml & "</DEST_LIST></BODY>"
'....
The above will result in this:
Code:
'.....
lsXml = lsXml & "<BODY><CONTENT>" & Text1 & "</CONTENT><DEST_LIST>"
lsXml = lsXml & "<TO>number1</TO><TO>number2</To>" '<--- this is what the function would return
lsXml = lsXml & "</DEST_LIST></BODY>"
'....
Thus, we only need to call that function only.
Hope it is clear now.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 30th, 2012, 12:36 PM
#138
Thread Starter
Enjoy the moment
-
May 30th, 2012, 12:42 PM
#139
Re: sending sms with listview and checkbox in listview
 Originally Posted by salsa31
i understand my friend and i did exactly what you said but it still dosnt send me the sms
When you tried multiple <TO> tags, you were able to send the SMS right ?
What the function does is the same. Loops through the ListView and generates the <TO> tags.
Do one thing, in your code, just before this line:
Code:
winObj.send (SendString)
place this line of code:
Check the content now printed in the Debug window and see whether the XML is correct. Check the "<TO>" part.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 30th, 2012, 12:45 PM
#140
Re: sending sms with listview and checkbox in listview
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 30th, 2012, 12:55 PM
#141
Thread Starter
Enjoy the moment
Re: [RESOLVED] sending sms with listview and checkbox in listview
my friend 1 little question
i talked to the company of the sms
and i buy from them 1000 sms for customers.
now the deal is that i need to open an acount for each customer to give him the sms he is paying for
lets say danny buy from me 200 sms
how do i use vb 6 in my project to connect to the web system with his user name and password
and that he can use the 200 sms and not the 1000 that i buy
how do i limit him?
the company told me that in the code of the sending there is a function like this.
can you help me with that?
i saw now that i can limit him in the acount that i have in the sms company
but how i make it connect from the code to the web and verify name and password?
your are a genius by the way
Last edited by salsa31; May 30th, 2012 at 12:59 PM.
-
May 30th, 2012, 12:58 PM
#142
Re: [RESOLVED] sending sms with listview and checkbox in listview
Go through the manual. And open a new thread regarding any doubt if you have with that.
But first go through the manual that the company had given you. If you didn't understand it. Read it 3 or 4 times. Still if you can't figure it out, create a thread in here.
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 30th, 2012, 01:01 PM
#143
Thread Starter
Enjoy the moment
Re: [RESOLVED] sending sms with listview and checkbox in listview
-
May 30th, 2012, 07:06 PM
#144
Re: [RESOLVED] sending sms with listview and checkbox in listview
thanks akhileshbc
for explaining what i was trying to show him
and even wrote a little code for him to try 
and salsa i guess your not fired anymore?
-
May 30th, 2012, 09:28 PM
#145
Re: [RESOLVED] sending sms with listview and checkbox in listview
 Originally Posted by Max187Boucher
thanks akhileshbc
for explaining what i was trying to show him
and even wrote a little code for him to try 
welcome 
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
May 31st, 2012, 05:38 AM
#146
Thread Starter
Enjoy the moment
Re: [RESOLVED] sending sms with listview and checkbox in listview
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
|