news_more.aspx.cs

来自「企业网站管理系统(C#.NET2003开发),供初学者学习!」· CS 代码 · 共 66 行

CS
66
字号
using System;
using System.Data;
using System.Data.OleDb;
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;

public partial class News_more : System.Web.UI.Page
{
    public string Titlep;
    public string Descriptionp;
    public string Keywordsp;
    protected void Page_Load(object sender, EventArgs e)
    {
        string ID =FunStr(Request.QueryString["ID"].ToString());

        GetContent contact = new GetContent();
        OleDbDataReader dr = contact.GetNewsList(ID);
        while (dr.Read())
        {
            this.Ltitle.Text = dr["title"].ToString() ;
            this.Lcontent.Text = dr["content"].ToString();
        }
        dr.Close();
        //title,des,con
        GetContent drt = new GetContent();
        OleDbDataReader drf = drt.GetTDC();
        while (drf.Read())
        {
            this.Titlep = drf["Title"].ToString();
            this.Descriptionp = drf["Description"].ToString();
            this.Keywordsp = drf["Keywords"].ToString();
        }
        drf.Close();
    }
    public static string FunStr(string str)
    {
        str = str.Replace("&", "");
        str = str.Replace("<", "");
        str = str.Replace(">", "");
        str = str.Replace("'", "");
        str = str.Replace("*", "");
        str = str.Replace("\n", "");
        str = str.Replace("\r\n", "");
        str = str.Replace("?", "");
        str = str.Replace("select", "");
        str = str.Replace("insert", "");
        str = str.Replace("update", "");
        str = str.Replace("delete", "");
        str = str.Replace("create", "");
        str = str.Replace("drop", "");
        str = str.Replace("delcare", "");
        str = str.Replace("   ", "");

        str = str.Trim();
        if (str.Trim().ToString() == "")
            str = "无";
        return str;
    } 
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?