using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using System.IO;
public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            FileInfo fi = new FileInfo(TextBox1.Text);
            if (!fi.Exists)
            {
                Response.Write("<script>alert('请输入文件名称及位置！ ')</script>");
                return;
            }
            else
            {
                TextBox2 .Text = Convert.ToString(fi.DirectoryName);//文件位置
                TextBox3 .Text  = Convert.ToString((fi.Length) / 1024) + "KB";//文件大小
                TextBox4 .Text  = Convert.ToString(fi.CreationTime);//创建时间
                TextBox5 .Text  = Convert.ToString(fi.LastWriteTime);//修改时间
                TextBox6 .Text  = Convert.ToString(fi.LastAccessTime);//上次访问时间
            }
        }
        catch (Exception error)
        {
            Response.Write("<script>alert('操作失败，原因为：" + error.ToString() + "')</script>");
        }
    }
}
