01.
02.
UlFileName =
"images/"
& FileUpload1.FileName
03.
Me
.FileUpload1.SaveAs(Server.MapPath(
"images/"
& FileUpload1.FileName))
04.
NewFileName =
"images/New_"
& FileUpload1.FileName
05.
Me
.LblText1.Text =
"File Name : "
& FileUpload1.FileName
06.
Me
.LblText2.Text =
"File Size : "
& FileUpload1.PostedFile.ContentLength
07.
Me
.LblText3.Text =
"File Type : "
& FileUpload1.PostedFile.ContentType
08.
lblComplete.Text =
" บันทึกไฟล์เสร็จสมบูรณ์ "
09.
10.
11.
Dim
objBitmap
As
Bitmap =
New
System.Drawing.Bitmap(Server.MapPath(UlFileName))
12.
Dim
objGraphic
As
Graphics = Graphics.FromImage(objBitmap)
13.
14.
15.
16.
17.
Dim
strFormat
As
New
StringFormat
18.
strFormat.Alignment = StringAlignment.Far
19.
strFormat.LineAlignment = StringAlignment.Far
20.
21.
22.
23.
24.
objBitmap.Save(Server.MapPath(NewFileName), ImageFormat.Jpeg)
25.
26.
27.
objGraphic.Dispose()
28.
29.
30.
objBitmap =
Nothing
31.
objGraphic =
Nothing
32.
33.
34.
Me
.imgPicture1.Visible =
True
35.
Me
.imgPicture1.ImageUrl = NewFileName