picsmall.aspx
来自「不错的ASP整站源代码。在IIS环境下运行都没有问题」· ASPX 代码 · 共 33 行
ASPX
33 行
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim image,aNewImage,aNewImage2 As System.Drawing.Image
dim width,height,newwidth,newheight,newwidth2,newheight2 as integer
Dim callb As System.Drawing.Image.GetThumbnailImageAbort
'生成缩略图
image=System.Drawing.Image.FromFile(Server.MapPath("/Up_files/product")&"/"&Request.QueryString("fname"))
width=image.Width
height=image.height
if width>height then
newwidth2=200
newheight2=image.height/image.Width*newwidth2
newwidth=120
newheight=image.height/image.Width*newwidth
else
newheight2=200
newwidth2=image.Width/image.height*newheight2
newheight=120
newwidth=image.Width/image.height*newheight
end if
aNewImage2=image.GetThumbnailImage(newwidth2,newheight2,callb,new System.IntPtr())
aNewImage2.Save(Server.MapPath("/Up_files/product/200/"+(Request.QueryString("fname"))))
aNewImage=image.GetThumbnailImage(newwidth,newheight,callb,new System.IntPtr())
aNewImage.Save(Server.MapPath("/Up_files/product/120/"+(Request.QueryString("fname"))))
image.Dispose()
End Sub
</script>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?