![]() |
Click here to advertise with us
|
|
|||||||
| Windows Forms Discussion related to Winforms application development |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 |
|
||||
|
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) |
|
|||
|
Quote:
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 |
|
||||
|
Code:
Me.PictureBox1.Load("www.something.com/" & Me.TextBox1.Text & "/something/" & Me.TextBox1.Text & "_" & Me.TextBox2.Text & ".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) |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|