protected void Page_Load(object sender, EventArgs e) { string filepath = Request["filepath"]; string filename = Request["filename"]; string fid = Request["fid"]; //下载时更新数据库 string SQL = "update files set downnum=downnum+1 where fid={0}"; SQLBASE.ExcuteNonQuery_SQL(string.Format(SQL, fid)); Response.Redirect(filepath + filename); }
/// <summary> /// 显示前几条新闻 /// </summary> private string ShowTopNews() { string SQL = "select nid,substring(title,0,12) as title from news"; //DataSet ds = News.ShowTop5News(); DataSet ds = SQLBASE.FillDataSet(SQL); StringBuilder strHtmlCode = new StringBuilder(1000); strHtmlCode.AppendFormat("<table height=\"175\"; align='center'>"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow row = ds.Tables[0].Rows[i]; strHtmlCode.AppendFormat("<tr><td align='center'><a href=ShowNews.aspx?nid={0} target='_self'>{1}<a></td></tr>", row["nid"].ToString(), row["TITLE"].ToString()); } strHtmlCode.AppendFormat("</table>"); return(strHtmlCode.ToString()); }
/// <summary> /// 显示前几条新闻 /// </summary> private string ShowTopNews() { string SQL = "select top 10 nid,substring(title,0,12) as title from news"; //DataSet ds = News.ShowTop5News(); DataSet ds = SQLBASE.FillDataSet(SQL); StringBuilder strHtmlCode = new StringBuilder(1000); strHtmlCode.AppendFormat("<marquee direction='up' onmouseover=this.stop() onmouseout=this.start() scrollAmount=3 scrollDelay=100><table height=\"175\"; align='center'>"); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DataRow row = ds.Tables[0].Rows[i]; strHtmlCode.AppendFormat("<tr><td align='center'><a href=ShowNews.aspx?nid={0} target='_blank'>{1}<a></td></tr>", row["nid"].ToString(), row["TITLE"].ToString()); } strHtmlCode.AppendFormat("</table></marquee>"); return(strHtmlCode.ToString()); }