📄 columncontent.ascx.cs
字号:
namespace ComputerWeb
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Configuration;
using System.Data.SqlClient;
/// <summary>
/// Summary description for SubTopicContent.
/// </summary>
public class ColumnContent : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.DataGrid myDataGrid;
protected System.Web.UI.WebControls.DataGrid FileDataGrid;
private int index = 0;
private int nId = 0;
private void Page_Load(object sender, System.EventArgs e)
{
// if(Session["SubTopicID"] != null)
// {
// index = Int32.Parse(Session["SubTopicID"].ToString());
// }
// nId = GetSubTopicID(ContentDB.subTopicID,index);
//
// if(!Page.IsPostBack)
// {
// BindData();
// }
}
private void BindData()
{
// ContentDB content = new ContentDB();
// UploadFileDB myFile = new UploadFileDB();
// SqlDataReader recc = content.GetFiveContents(nId);
//
// myDataGrid.DataSource = recc;
// myDataGrid.DataBind();
//
// recc.Close();
//
// SqlDataReader drFile = myFile.GetFileBySubTopic(nId);
// FileDataGrid.DataSource= drFile;
// FileDataGrid.DataBind();
//
// drFile.Close();
}
// private int GetSubTopicID(int[] subtopId,int idx)
// {
// Session["SubTopicID"] = (++idx).ToString();
// return(subtopId[idx -1]);
// }
// public String FormatFilePath(String sFilePath)
// {
// String address = "";
//
// if(sFilePath.ToLower().IndexOf("\\upload",0,sFilePath.Length) > -1)
// {
// //网站内部的文件地址
// address = Request.ApplicationPath + sFilePath;
// }
// else
// {
// //网络地址(mailto,http和ftp)
// if(sFilePath.IndexOf("@",0,sFilePath.Length) > -1)
// {
// //处理邮件地址
// if(sFilePath.Substring(0,sFilePath.Length > 6 ? 7:sFilePath.Length ).ToLower() == "mailto:")
// {
// address = sFilePath;
// }
// else
// {
// address = "mailto:" + sFilePath;
// }
// }
// else
// {
// if(sFilePath.Substring(0,sFilePath.Length > 2 ? 3:sFilePath.Length).ToLower() == "ftp")
// {
// //处理ftp地址
// if(sFilePath.ToLower().IndexOf("ftp://",0,sFilePath.Length) > -1)
// {
// address = sFilePath;
// }
// else
// {
// address = "ftp://" + sFilePath;
// }
// }
// else
// {
// //处理http地址
// if(sFilePath.ToLower().IndexOf("http://",0,sFilePath.Length) > -1)
// {
// address = sFilePath;
// }
// else
// {
// address = "http://" + sFilePath;
// }
// }
// }
// }
//
// return(address);
// }
//
// public String FormatTime(String dtime)
// {
// if(dtime != "")
// {
// String[] timeString = dtime.Substring(1,dtime.Length -2).Split('-');
// String time = "";
// for(int i = 0; i < timeString.Length; i++)
// {
// if(timeString[i][0].ToString() == "0")
// {
// time += timeString[i].Substring(1);
// }
// else
// {
// time += timeString[i];
// }
// }
// if(time == DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString())
// {
// return("<font color=Red>" + dtime + "</font>");
// }
// else
// {
// return(dtime);
// }
// }
// else
// {
// return null;
// }
// }
#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
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -