ShowPhoto.aspx.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

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 ASPNETAJAXWeb.AjaxAlbum;
using System.Data.SqlClient;
using AjaxControlToolkit;

public partial class ShowPhoto : System.Web.UI.Page
{
	private int categoryID = -1;
	private int photoID = -1;

	protected void Page_Load(object sender,EventArgs e)
	{   ///获取当前分类的ID值
		if(Request.Params["CategoryID"] != null)
		{
			categoryID = Int32.Parse(Request.Params["CategoryID"].ToString());
		}
		///获取当前当前的ID值
		if(Request.Params["PhotoID"] != null)
		{
			photoID = Int32.Parse(Request.Params["PhotoID"].ToString());
		}
		///显示当前图片
		if(!Page.IsPostBack && photoID > 0)
		{
			ShowCurrentPhoto(photoID);
			return;
		}		
	}

	private void ShowCurrentPhoto(int photoID)
	{   ///获取图片的数据
		Album album = new Album();
		SqlDataReader dr = album.GetSinglePhoto(photoID);
		if(dr == null) return;
		if(dr.Read())
		{   ///显示图片的数据
			imgShow.ImageUrl = dr["Url"].ToString();
			lbShow.Text = dr["Title"].ToString();
		}
		dr.Close();
		///当前图片的索引值
		int currentIndex = -1;
		///根据分类ID获取其图片
		DataSet ds = album.GetPhotoByCategory(categoryID);
		if(ds == null || ds.Tables.Count <= 0 || ds.Tables[0].Rows.Count <= 0) return;
		///创建被播放图片的数组
		Slide[] photoes = new Slide[ds.Tables[0].Rows.Count];
		for(int i = 0; i < ds.Tables[0].Rows.Count; i++)
		{   ///创建一张图片的数组
后面还有 59 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。