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
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: