Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > VB.NET > Windows Forms

Windows Forms Discussion related to Winforms application development

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-28-2009, 2:25 AM
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 2:26 AM. Reason: mistyping
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-29-2009, 4:35 AM
Robert_Zenz's Avatar
VB.NET Forum Idol
.NET Framework: .NET 2.0
 
Join Date: Jun 2008
Location: Vienna, Austria
Age: 22
Posts: 503
Reputation: 289
Robert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NET
Default

Code:
Me.PictureBox1.Load("www.somethin g.com/" & a & "/something/" & a & "_" & b & ".jpg")
?

Bobby
__________________
Don't give TypeCasting Errors a chance, turn ON Option Strict!
Greatest Obfuscator ever: EazFuscator (Freeware)
Greatest Reflection Tool ever: .NET Reflector (Freeware) with Add-Ins
Greatest Introspection Tool ever: Gendarme (GPL)
Greatest MySQL FrontEnd ever: MySQL-Front (Shareware), HeidiSQL (GPL)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-06-2009, 11:47 PM
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

Quote:
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-07-2009, 4:31 AM
Robert_Zenz's Avatar
VB.NET Forum Idol
.NET Framework: .NET 2.0
 
Join Date: Jun 2008
Location: Vienna, Austria
Age: 22
Posts: 503
Reputation: 289
Robert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NETRobert_Zenz master of VB.NET
Default

Code:
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
__________________
Don't give TypeCasting Errors a chance, turn ON Option Strict!
Greatest Obfuscator ever: EazFuscator (Freeware)
Greatest Reflection Tool ever: .NET Reflector (Freeware) with Add-Ins
Greatest Introspection Tool ever: Gendarme (GPL)
Greatest MySQL FrontEnd ever: MySQL-Front (Shareware), HeidiSQL (GPL)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 12:17 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.