View Single Post
  #1 (permalink)  
Old 06-28-2009, 1:25 AM
thatguy113 thatguy113 is offline
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Jun 2009
Age: 21
Posts: 2
Reputation: 0
thatguy113 is on a distinguished programming path ahead
Default Need help developing web image viewer

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.somethin g.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 by thatguy113; 06-28-2009 at 1:26 AM. Reason: mistyping
Reply With Quote