Page 4 of 4 FirstFirst 1234
Results 121 to 146 of 146

Thread: [RESOLVED] sending sms with listview and checkbox in listview

  1. #121
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    did u load the numbers in listbox ?

  2. #122

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    yes i did name and number

  3. #123
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    snd me ur frm , with changes i told u

  4. #124

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    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.

  5. #125
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    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, "&#37;", "%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

  6. #126

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    Object not an array
    i get error

  7. #127
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by salsa31 View Post
    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:
    1. Private Function getSelectedNums() As String
    2.     Dim temp As String
    3.     temp = ""
    4.    
    5.     Dim i As Long
    6.     For i = 1 To ListView1.ListItems.Count  '~~~ Loop through the listview
    7.         If ListView1.ListItems(i).Checked = True Then   '~~~ if an item is checked
    8.             temp = temp & "<TO>" & ListView1.ListItems(i).SubItems(1) & "</TO>"    '~~~ enclose the number in "<TO>" tags
    9.         End If
    10.     Next
    11.    
    12.     getSelectedNums = temp  '~~~ return it
    13. 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,...

  8. #128
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    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, "&#37;", "%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

  9. #129

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    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

  10. #130
    Hyperactive Member
    Join Date
    May 2012
    Posts
    339

    Re: sending sms with listview and checkbox in listview

    snd me ur frm bro

  11. #131
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by salsa31 View Post
    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,...

  12. #132

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    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.

  13. #133
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by salsa31 View Post
    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,...

  14. #134

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by akhileshbc View Post
    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.

  15. #135
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  16. #136

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    <TO>number1</TO>number2</To> this is what i get

  17. #137
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  18. #138

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: sending sms with listview and checkbox in listview

    yeahhhhhhhhhhh
    its workingggggg for the love of godddddddddddd
    tnxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    you saved my lifeeeeee
    Last edited by salsa31; May 30th, 2012 at 12:41 PM.

  19. #139
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by salsa31 View Post
    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:
    Code:
    Debug.Print lsXml
    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,...

  20. #140
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: sending sms with listview and checkbox in listview

    Quote Originally Posted by salsa31 View Post
    yeahhhhhhhhhhh
    its workingggggg for the love of godddddddddddd
    tnxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    you saved my lifeeeeee
    You are 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,...

  21. #141

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    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.

  22. #142
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    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,...

  23. #143

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: [RESOLVED] sending sms with listview and checkbox in listview


  24. #144
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    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?

  25. #145
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: [RESOLVED] sending sms with listview and checkbox in listview

    Quote Originally Posted by Max187Boucher View Post
    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,...

  26. #146

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: [RESOLVED] sending sms with listview and checkbox in listview

    Quote Originally Posted by Max187Boucher View Post
    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?
    tnx to akhileshbc for solving and helped me.
    this form and the giftit people here never let me down.

Page 4 of 4 FirstFirst 1234

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width