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.IO;
namespace TipsTricks.Ch4
{
/// <summary>
/// Summary description for ListImage.
/// </summary>
public class ListImage : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataList DataList1;
foreach (string s in files)
{
DataRow dr=dt.NewRow();
FileInfo f=new FileInfo(s);
dr["filename"]=f.Name;
dr["size"]=f.Length;
dt.Rows.Add(dr);
}
//绑定显示
this.DataList1.DataSource=dt;
this.DataList1.DataBind();
}
}
public void HHH(object sender, System.EventArgs e)
{
this.Response.Write("hello");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
生成缩略图
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Drawing.Imaging;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
namespace TipsTricks.Ch4
{
/// <summary>
/// Summary description for ShowSmallImage.
/// </summary>
public class ShowSmallImage : System.Web.UI.Page
{
const int MaxLength=150; //最大长度
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}