Tips&Tricks | I trucchi del mestiere |
![]() |
Creare delle immagini formato thumbnail |
<% Const MINPIXELS = 100 Set objImageSize = Server.CreateObject("ImgSize.Check") objImageSize.FileName = Server.MapPath("IMG.jpg") ImageHeight = objImageSize.Height ImageWidth = objImageSize.Width If ImageHeight > ImageWidth Then NewHeight = Cint(ImageHeight*MINPIXELS/ImageWidth) NewWidth = MINPIXELS Else NewWidth = Cint(ImageWidth*MINPIXELS/ImageHeight) NewHeight = MINPIXELS End If Set objImageSize = Nothing '*** Creazione dell'immagine thumbnail Set Image = Server.CreateObject("AspImage.Image") Image.LoadImage(Server.MapPath("IMG.jpg")) Image.FileName = Server.MapPath("IMG_piccola.jpg") Image.ImageFormat = 1 Image.JPEGQuality = 70 Image.Resize NewWidth,NewHeight Image.SaveImage Set Image = Nothing %> |
![]() |
Creare un documento Word da ASP |
<form action="word_create.asp"> Name: <input type="text" name="Nome" size="50" maxlength="100"> Email: <input type="text" name="Email" size="50" maxlength="100"> Commenti: <textarea cols="50" rows="10" name="commenti"></textarea> <input type="submit" value="Submit"> </form> |
<% Response.ContentType = "application/msword" %> <html> <% strNome = Request.Querystring("Nome") strEmail = Request.Querystring("Email") strCommenti = Request.Querystring("Commenti") %> <head> </head> <body> <p align="right"><%=formatdatetime(now,2)%></p> Dear <%= strnome %>: Il mio indirizzo email Φ: <%= stremail %> Ecco qui i commenti: <%= strCommenti %> </body> </html> |