|
-
May 4th, 2010, 02:11 PM
#1
Thread Starter
Lively Member
Listbox Items And Images
I've decided to edit this thread as its pretty complicated to understand my problem in the way i've worded it.
I want to make an application that's pretty much all server side.
I have everything sorted, apart from downloading images from my server.
I have a listbox containing all the game names, in this format.
Code:
pacman
rallyx
mspacman
asteroids
There are many more, thats just an example.
Each game name is stored as a folder on my server. Inside those folders is the games boxart, called boxart.png
What i want to do is make an application that makes those folders and downloads the images.
I have made the "create a folder for each game name" code already, now i just need to add another line or two to download the image inside those created folders.
Code:
For x As Integer = 0 To ListBox1.Items.Count - 1
My.Computer.FileSystem.CreateDirectory("C:\Users\Joel\Desktop\ids\" + ListBox1.Items(x).ToString)
next
Could anyone help me with this ??
I would greatly appreciate the help as it seems a simple task but i'm having trouble with it.
Last edited by JJMPSP; May 9th, 2010 at 06:51 AM.
Reason: reworded problem
-
May 4th, 2010, 04:51 PM
#2
Re: Make a folder with a downloaded image inside it ?
What is the format of the listbox items?
Perhaps that could give us an indication of what is wrong...
VB.NET MVP 2008 - Present
-
May 4th, 2010, 07:13 PM
#3
Re: Make a folder with a downloaded image inside it ?
P.S. You should Close and Dispose the StreamWriter.
-
May 7th, 2010, 05:46 PM
#4
Thread Starter
Lively Member
Re: Make a folder with a downloaded image inside it ?
Sorry guys, i have been away for a couple of days, back now though 
Want I want to do is make a folder for each item in the listbox and also download an image into those created folders.
the format of the listbox is :
584109B7
584109A8
584108AA
58410975
so an id per line.
each downloaded image should be saved from the picturebox on the form.
Hope this explains the problem in more detail .
Thanks
-
May 8th, 2010, 12:32 PM
#5
Thread Starter
Lively Member
Re: Make a folder with a downloaded image inside it ?
Anybody know a code then ?
I dont want to do it manually, it will take ages
-
May 8th, 2010, 12:54 PM
#6
Re: Make a folder with a downloaded image inside it ?
maybe if you provided the info of where the picture is being downloaded from etc... someone may help a bit sooner ( i know you say there's a picturebox, but when you click the list does it point to loading an image from somewhere on a pc? from a website? )
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
May 8th, 2010, 01:05 PM
#7
Thread Starter
Lively Member
Re: Make a folder with a downloaded image inside it ?
oh what an idiot i am, i never thought of that.
picturebox1 get its image from a url from the internet.
codeview:
so each item is unique by its id, I have already made the folders on my server and uploaded the boxart for each game. Now i want a user to click a button and download each boaxart into its own folder (listbox1.selecteditem in this case)
I made a code for making folders as I said, but now I just need the images to save to those unique folders.
Lol its pretty hard to explain, i hope you understand.
Many thanks for reading.
Last edited by JJMPSP; May 8th, 2010 at 01:09 PM.
-
May 9th, 2010, 06:53 AM
#8
Thread Starter
Lively Member
Re: Listbox Items And Images
i just updated the first post so its easier for people to understand my problem.
-
May 9th, 2010, 04:41 PM
#9
Re: Listbox Items And Images
Call DownloadImage() when the button is clicked:
Code:
Private Sub DownloadImage()
If Me.ListBox1.SelectedIndex = -1 Then Exit Sub
Dim s As String = DirectCast(Me.ListBox1.SelectedItem,String)
Using wc As New Net.WebClient()
wc.DownloadFile("http://www.jtagxbox360.info/" & s & "/boxart.png",s & "_boxart.png")
End Using
End Sub
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
|