Need help developing web image viewer

thatguy113

New member
Joined
Jun 28, 2009
Messages
2
Programming Experience
Beginner
I'm BRAND NEW to programming, and I'm starting to learn VB. I need to write a program that views images on a website that are organized. I have 2 textboxes in which you enter variables which affect the URL. It doesn't load anything though when I enter values into the textboxes. Here is the code:
Dim shoot As String

a = TextBox1.Text

Dim pic As String

b = TextBox2.Text



Dim req As Net.HttpWebRequest = DirectCast(Net.HttpWebRequest.Create("www.something.com/" & a & "/something/" & a & "_" & b & ".jpg"), Net.HttpWebRequest)

Dim res As Net.HttpWebResponse = DirectCast(req.GetResponse, Net.HttpWebResponse)

Dim img As Image = New System.Drawing.Bitmap(res.GetResponseStr...

res.Close()

PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage

PictureBox1.Image = img

How do I fix this? Preferably with a button that only loads the picture when pressed





Also, i want to be able to enter something else in the textboxes and be able to press the button again to load the new image
 
Last edited:
Me.PictureBox1.Load("www.somethin g.com/" & a & "/something/" & a & "_" & b & ".jpg")

this is the basic format for the web URL that the program is supposed to visit using variables "a" and "b" as in www.something.com/a/something/a_b.jpg

it wont load a picture though, and when I type something in I dont know how to make it so that it will store the variables and re-access the new URL

Again, I'm very new to VB.Net and programming in general, and all I need is a basic program
 
VB.NET:
Me.PictureBox1.Load("www.something.com/" & Me.TextBox1.Text & "/something/" & Me.TextBox1.Text & "_" & Me.TextBox2.Text & ".jpg")

'cause it does not load, my means it's not there. Wait a minute...where did you put this code? Add a button to the form and put this code into it's click event (do a doubleclick on it).

Bobby
 
Back
Top