Previously, third-party components must be used to implement thumbnails on the page. Now, with. NET, you can easily implement thumbnails. The following is an example of how to implement a thumbnail.
ToThumbnailImage. aspx
<% @ Page language = "c #" Codebehind = "ToThumbnailImage. aspx. cs" Src = "ToThumbnailImage. aspx. cs" AutoEventWireup = "false"
Inherits = "Exam_C.ToThumbnailImage" %>
<Html>
<Head>
<Title> Lion interactive network => generating thumbnails </title>
</Head>
<Body>
<Form id = "Form1" method = "post" runat = "server">
</Form>
</Body>
</Html>
ToThumbnailImage. aspx. cs
Using System;
Using System. Collections;
Using System. ComponentModel;
Using System. Data;
Using System. Drawing;
Using System. Web;
Using System. Web. SessionState;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Using System. Web. UI. HtmlControls;
Using System. Drawing. Imaging;
Namespace Exam_C
{
/// <Summary>
/// Summary of ToThumbnailImage.
/// </Summary>
Public class ToThumbnailImage: System. Web. UI. Page
{
/*
Create By lion
Copyright (C) 2004 www. LionSky. Net. All rights reserved.
Web: http://www.Lionsky.net;
Email: lion-a@sohu.com
*/
Static Hashtable htmimes = new Hashtable ();
Internal readonly string AllowExt = ". jpe |. jpeg |. jpg |. png |. tif |. tiff |. bmp ";