tony
2006-04-13 15:34:02 UTC
œÐ±Ð€@€U,šÏ¥Î€U±ªºµ{Š¡€W¶ÇšÃ¥ÍŠšÁY²€¹Ï.Šý·|²£¥Í¥H€U¿ù»~:
The process cannot access the file 'D:\WEB\img\37.jpg' because it is being
used by another process.
Šý³Ì«áCHECKµo²{¹Ï€ù€wžg€W¶ÇŠš¥\,¥ÍŠšÁY¹Ï€]Šš¥\...©_©Ç
µ{Š¡:
Protected Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.FormViewUpdateEventArgs) Handles
FormView1.ItemUpdating
Dim FileUpload1 As FileUpload = FormView1.FindControl("FileUpload1")
Dim Image, Anewimage As System.Drawing.Image
Dim width, height, newwidth, newheight As Integer
Dim callb As System.Drawing.Image.GetThumbnailImageAbort
If FileUpload1.HasFile Then
Dim id As String = e.Keys("Pro_id").ToString 'šú±o°O¿ýID
Dim fileName As String = id & ".jpg"
FileUpload1.SaveAs(Server.MapPath("../img/") & fileName) '€W¶Ç
'e.NewValues("pic") = fileName
Image = System.Drawing.Image.FromFile(Server.MapPath("../img/")
& fileName)
width = image.Width
height = image.Height
If width > height Then
newwidth = 110
newheight = image.Height / image.Width * newwidth
Else
newheight = 110
newwidth = Image.Width / Image.Height * newheight
End If
Anewimage = Image.GetThumbnailImage(newwidth, newheight, callb,
New System.IntPtr())
Anewimage.Save(Server.MapPath("../img_s/") & fileName)
End If
End Sub
·P·Å!!!
The process cannot access the file 'D:\WEB\img\37.jpg' because it is being
used by another process.
Šý³Ì«áCHECKµo²{¹Ï€ù€wžg€W¶ÇŠš¥\,¥ÍŠšÁY¹Ï€]Šš¥\...©_©Ç
µ{Š¡:
Protected Sub FormView1_ItemUpdating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.FormViewUpdateEventArgs) Handles
FormView1.ItemUpdating
Dim FileUpload1 As FileUpload = FormView1.FindControl("FileUpload1")
Dim Image, Anewimage As System.Drawing.Image
Dim width, height, newwidth, newheight As Integer
Dim callb As System.Drawing.Image.GetThumbnailImageAbort
If FileUpload1.HasFile Then
Dim id As String = e.Keys("Pro_id").ToString 'šú±o°O¿ýID
Dim fileName As String = id & ".jpg"
FileUpload1.SaveAs(Server.MapPath("../img/") & fileName) '€W¶Ç
'e.NewValues("pic") = fileName
Image = System.Drawing.Image.FromFile(Server.MapPath("../img/")
& fileName)
width = image.Width
height = image.Height
If width > height Then
newwidth = 110
newheight = image.Height / image.Width * newwidth
Else
newheight = 110
newwidth = Image.Width / Image.Height * newheight
End If
Anewimage = Image.GetThumbnailImage(newwidth, newheight, callb,
New System.IntPtr())
Anewimage.Save(Server.MapPath("../img_s/") & fileName)
End If
End Sub
·P·Å!!!