none
Get image count

    Question

  • Hi everyone,

    I'm still using SL 1.0 for one of my app, and I have a gallery of images...the issue I have is that I would like to know how may images is there in my .zip file (?)

    Thank you for you help.

    Wednesday, June 11, 2008 9:24 AM

Answers

  •  Hi,

    Instead of using text file u can use xml file.

    for that u have to use JavaScript's activex object. 

    Thursday, June 12, 2008 4:19 AM
  •  

    I would agree, if you dont use any servside pages (php, asp, aspx) then reading an xml file would be better than a txt file.
    Thursday, June 12, 2008 12:28 PM

All replies

  • I doubt it can be done on the client using javascript, but if you use the downloader object to access the response of an .aspx page using the link below.

    I did a quick google and found this: http://groups.google.co.uk/group/microsoft.public.vb.general.discussion/msg/af374a38d8cfe0fb

     

    Wednesday, June 11, 2008 2:31 PM
  • I am not sure if it is possible to enumerate files in zip file loaded with silverlight downloader. In fact I think you can't. If you are the one who creates the zip file just pass a json string along with list of all files contained in the zip file. Alternatively name files in zip archive using predetermined pattern. For example File1, File2, etc.
    Wednesday, June 11, 2008 2:34 PM
  • Thats not what I said or at least, meant ;)
    but if you use the downloader object to access the response of an .aspx page "

    you would have that .aspx do the work for you, and return the image count back to the client using the sender.responsetext() value of the downloader as json or just a string.

    if the poster doesnt know how to use the downloader to an .aspx page, here is a tutorial on how to:
    http://www.gjhdigital.com/gjhdigital/sl/JSONSilverlight/

     

     

    Wednesday, June 11, 2008 2:43 PM
  • Actually I was wondering, if i might add simple txt file in my .zip folder where I would write names of all my images, and then read this file or somehow get count or all names of images...can something like this be done using JS in SL 1.0 (?)

     

    Thnx.

    Thursday, June 12, 2008 2:57 AM
  •  Hi,

    Instead of using text file u can use xml file.

    for that u have to use JavaScript's activex object. 

    Thursday, June 12, 2008 4:19 AM
  • Hmmn ok, thnx for the info. on this matter.

    Thursday, June 12, 2008 4:25 AM
  •  

    I would agree, if you dont use any servside pages (php, asp, aspx) then reading an xml file would be better than a txt file.
    Thursday, June 12, 2008 12:28 PM
  • Thnx again for this info.

    Thursday, June 12, 2008 2:07 PM