1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
If Request("boitier") = "" Then
For Each a As String In Directory.GetFiles(Server.MapPath("~\") & "assemblage\Boitier\")
Dim root As String = Replace(a, "d:\www\unknow-computer.com\htdocs\", "http://www.unknow-computer.com/")
Dim imgbut As New ImageButton
imgbut.ImageUrl = root
imgbut.Height = 100
imgbut.Width = 200
Panel1.Controls.Add(imgbut)
Dim filename As String = ""
Dim temp As String() = Split(a, "\")
For Each b As String In temp
If b.Contains(".jpg") Then
filename = b
End If
Next
imgbut.PostBackUrl = "?boitier=" & filename
Next
end if
end sub |
Partager