SiteExperts.com Logo Home | Community | Developer's Paradise
User Groups | Site Tools | Site Information | Search
 Main Menu
 Forums
SiteExperts.com Forums
All Discussions

SiteExperts Feedback
The Lounge
Dynamic HTML
Site Design/ Critiques
HTML and CSS
XML Technologies
The Wireless Internet
Internet Explorer
Microsoft .NET
The Server
Technical Support

Sponsored Links

User Groups : Forums : SiteExperts : Microsoft .NET :

Previous DiscussionNext Discussion
 Get multiple files from a server with Silverlight...

Ok, I know this might sound cheesy, but I want to do an "image carousel", or some other type of dynamic image display in Silverlight.

The issue I am having is that I want to be able to pull the images from a specific directory on a server, and I don't know how many or what their names are.

This is for a project I am working on, that I want to show a guy I know who runs a sports site for a local high school (American) football team.

Basically, the way it works now is that they just upload a bunch of game photos and an HTML page that is a table with references to all the photos in it.

I want to make it a little more dynamic. Since I'm actually helping him out with the site, I have the directory structure, so that really isn't a problem.

In simpler terms, what I want is this: When the Silverlight app loads, I want it to go to this server, search directory X, grab all the photos (in .jpg format), and pull them back to the Silverlight app.

I originally wrote an app for them (WinForms) that shrinks down the dimensions of the game photos and creates the HTML. They love it. Well, I love it, because I put up the photos. But they've started using it for other sports, so I sent a guy a copy, and he uses it for the other sports.

Anyway, thoughts, suggestions, ideas, URLs?

Started By Monte on Jun 16, 2010 at 5:04:51 AM

3 Response(s) | Reply

Earlier Replies | Replies 1 to 3 of 3 | Later Replies
brian on Jun 16, 2010 at 5:52:47 AM (# 1)

I'd suggest a trawl through the videos on www.silverlight.net/learn as it has some good stuff and may even have the answer you're looking for. I do know there's a carousel example but I am not sure how it gets the files. We (my colleague and I) also created a tool for the offshore industry using silverlight that pulls down video and images on demand. I don't think it was difficult to do but then I never wrote that part of it.


Monte on Jun 23, 2010 at 11:21:35 AM (# 2)

Ok...I've changed my approach here temporarily.

All I want to do now is download an XML file.

I tried using XmlReader, and I even included the System.Net namespace, but I can't find HttpWebRequest or WebClient in order to use them.

I don't know what's wrong.

Any thoughts or advice?

All I want to do is pull an XML file from a server, iterate through the nodes, and pull out the images.


brian on Jun 24, 2010 at 1:31:25 AM (# 3)

This is SL2 but dont thinks would have changed too much since then. Code came from SL2 Unleashed.


WebClient client=new WebClient();
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(handler_goes_here);
client.DownloadStringAsync(new Url("file.XML",UriKind.Relative);

You can probably change to an absolute path and the handler will fire once the file/string is available for processing.

Hope this helps Monte. let me know how you get on with this.

B
Earlier Replies | Replies 1 to 3 of 3 | Later Replies

To respond to a discussion, you must first logon.

If you are not registered, please register yourself to become a member of the SiteExperts.community.

User Name
Password
Copyright 1997-2004 InsideDHTML.com, LLC. All rights reserved.