以前,在页面上实现缩略图必须借助第三方组件。现在,有了.NET,就可以很轻松地实现缩略图。下面就是实现缩略图的例子。
ToThumbnailImage.aspx
<%@ Page language="c#" Codebehind="ToThumbnailImage.aspx.cs" Src="ToThumbnailImage.aspx.cs" AutoEventWireup="false"
Inherits="Exam_C.ToThumbnailImage" %>
Lion互动网络 =>生成缩略图 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
{
///
/// ToThumbnailImage 的摘要说明。
/// public class ToThumbnailImage : System.Web.UI.Page
{
/*
Create By lion
2003-05-20 19:00
Copyright (C) 2004 www.LionSky.Net. All rights reserved.
Web: http://www.Lionsky.net ;
Email:
[email protected] */
static Hashtable htmimes=new Hashtable();
internal readonly string AllowExt = ".jpe|.jpeg|.jpg|.png|.tif|.tiff|.bmp";