zoul1380
03-28-2007, 08:23 AM
How can i display an image which is specified in my PC in an IMAGEBOX in ASP.NET here is my code.
Assume that there is 10 Jpg File in my specified Directory.
Please Help Me thanks.. im just a newbie :) on ASP.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
GetFiles()
End If
End Sub
Private Sub GetFiles()
Dim JPGFile() As String = System.IO.Directory.GetFiles("C:\Documents and Settings\rom\My Documents\My Pictures\Test", "*.jpg")
Dim x As Integer
For x = LBound(JPGFile) To UBound(JPGFile)
Response.Write(JPGFile(x) & "<BR>")
Next
Image1.ImageUrl = JPGFile(1).ToString
End Sub
Assume that there is 10 Jpg File in my specified Directory.
Please Help Me thanks.. im just a newbie :) on ASP.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
GetFiles()
End If
End Sub
Private Sub GetFiles()
Dim JPGFile() As String = System.IO.Directory.GetFiles("C:\Documents and Settings\rom\My Documents\My Pictures\Test", "*.jpg")
Dim x As Integer
For x = LBound(JPGFile) To UBound(JPGFile)
Response.Write(JPGFile(x) & "<BR>")
Next
Image1.ImageUrl = JPGFile(1).ToString
End Sub