using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using UUN;
using System.Data.SqlClient;
using System.IO;

public partial class Content : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        常用.更新缓存(this.Context);
        int ID=Convert.ToInt32(Request.QueryString["ID"]);
        int CID=Convert.ToInt32(Request.QueryString["CID"]);

        DataRow 栏目 = 常用.获取栏目(CID);
        if (栏目 == null)
            throw new Exception("内容不存在");

        int 默认模板 = 0;
        switch (栏目["栏目类型"].ToString())
        {
            case "文章":
                默认模板 = 11;
                break;
            case "图片":
                默认模板 = 13;
                break;
            case "软件":
                默认模板 = 15;
                break;
            case "音乐":
                默认模板 = 17;
                break;
            case "视频":
                默认模板 = 19;
                break;
        }

        if (File.Exists(Server.MapPath("~/Template/Content/" + 程序.设置["默认模板"] + "/Content_Aspx/" + 栏目["模板_查看内容"] + ".aspx")))
            Server.Execute("~/Template/Content/" + 程序.设置["默认模板"] + "/Content_Aspx/" + 栏目["模板_查看内容"] + ".aspx");
        else
            Server.Execute("~/Template/Content/默认模板/Content_Aspx/" + 默认模板 + ".aspx");
    }
}
