Else
For Each key As String In e.PostValues.Keys
If key.Contains("imgs_") Then
Dim bs As Byte() = Convert.FromBase64String(e.PostValues(key).split(",")(1))
Dim stream As System.IO.Stream = New System.IO.MemoryStream(bs)
Dim bmp As System.Drawing.Bitmap = New System.Drawing.Bitmap(stream)
bmp.Save("c:\web\xp\" & e.Cookies("username") & ".jpg", ImageFormat.Jpeg)
Dim slt As String ="c:\web\xp\" & e.Cookies("username") & ".jpg"
Dim img1 As image = getImage(slt)
Dim bmp1 As bitmap
If img1.width > 800 Then
If 800 * (img1.height / img1.width) > 600 Then
bmp1 = new bitmap(img1, 800*(600/(800*(img1.height/img1.width))), 600)
Else
bmp1 = new bitmap(img1, 600, 600 * (img1.height / img1.width))
End If
End If
bmp1.save(slt, ImageFormat.Jpeg)
bmp1.Dispose
End If
Next
With wb.AddMsgPage("","msgpage","上传成功", "") '生成成功提示页
Dim bt1=.AddButton("btn1","确定","xpcj.htm")
bt1.kind=1
bt1.Attribute = "style='border:1px solid black;border-radius:20px;padding:0px;width:50%'"
End With
End If
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/common.js'></script>", True)
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/camera.js'></script>")
e.WriteString(wb.Build)
当照的相或选择的原图比较大(如几M),上传时有点慢,测试过很容易卡死,自动关闭了,上面上传代码如何提高效率,成其连续测试两张就更容易,是不是所谓内存溢出,当原图小时没问题,这该怎么办,?