918博天堂

Server : Microsoft-IIS/10.0
System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586
User : jxgj ( 0)
PHP Version : 7.0.33
Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server
Directory :  D:/tmp_aspnet/root/a99112df/ca2a8923/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : D:/tmp_aspnet/root/a99112df/ca2a8923/App_Web_6cnqwm8s.15.cs
?#pragma checksum "D:\wwwroot\ldxynb\wwwroot\content.aspx.cs" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "128162B4A6CCCDAB03155BC193E7E7B9"

#line 1 "D:\wwwroot\ldxynb\wwwroot\content.aspx.cs"
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 CoreClass;
using System.Text.RegularExpressions;


public partial class content : System.Web.UI.Page
{

    #region 界说
    public string newsHtml;
    public DBCommon DB = new DBCommon();
    public PublicFunction pubfun = new PublicFunction();
    public string gsjj;
    public string jpwh;

    public string titless = "";

    public string neirongss = "";

    #endregion


    yingshi bs = new yingshi();

    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {


            //关于918博天堂
            DataSet ds4 = DB.GetDataSetBySql("select top 1 title,infoid,econtent,content from info where classid=135 and  recommend=true and Inspect=true order by ordernum desc");
            if (ds4.Tables[0].Rows.Count > 0)
            {
                titless = checkStr(ds4.Tables[0].Rows[0]["title"].ToString());
                neirongss = ds4.Tables[0].Rows[0]["content"].ToString();
            }



        }
    }



    protected void Button1_Click(object sender, EventArgs e)
    {

        if (pubfun.IsBlank(this.Text5.Value))
        {
            pubfun.Alert(Page, "您的主题!");
            this.Text5.Focus();
            return;
        }

        if (pubfun.IsBlank(this.Text1.Value))
        {
            pubfun.Alert(Page, "怎么称号您!");
            this.Text1.Focus();
            return;
        }
        if (pubfun.IsBlank(this.Text2.Value))
        {
            pubfun.Alert(Page, "您的联系电话!");
            this.Text2.Focus();
            return;
        }

        if (pubfun.IsBlank(this.Text3.Value))
        {
            pubfun.Alert(Page, "您的邮箱地址!");
            this.Text3.Focus();
            return;
        }
        if (pubfun.IsBlank(this.Text4.Value))
        {
            pubfun.Alert(Page, "您的留言内容!");
            this.Text4.Focus();
            return;
        }

     



        //string tissss = checkStr(Text4.Value.ToString()).ToString().Substring(0, 15);

        ////bs.user("Insert into downinfo(title,[name],tel,email,content) values('" + Text5.Value.Replace("'", "") + "','" + Text1.Value.Replace("'", "") + "','" + Text2.Value.Replace("'", "") + "','" + Text3.Value.Replace("'", "") + "','" + Text4.Value.Replace("'", "") + "')");

        pubfun.Location(Page, "留言提交成功!", Request.Url.AbsoluteUri);
    }


    protected void Submit1_ServerClick(object sender, EventArgs e)
    {

        //if (pubfun.IsBlank(this.Text1.Value))
        //{
        //    pubfun.Alert(Page, "怎么称号您!");
        //    this.Text1.Focus();
        //    return;
        //}
        //if (pubfun.IsBlank(this.Text2.Value))
        //{
        //    pubfun.Alert(Page, "您的联系电话!");
        //    this.Text2.Focus();
        //    return;
        //}

        //if (pubfun.IsBlank(this.Text3.Value))
        //{
        //    pubfun.Alert(Page, "您的邮箱地址!");
        //    this.Text3.Focus();
        //    return;
        //}
        //if (pubfun.IsBlank(this.Text4.Value))
        //{
        //    pubfun.Alert(Page, "您的留言内容!");
        //    this.Text4.Focus();
        //    return;
        //}

        //if (pubfun.IsBlank(this.Text5.Value))
        //{
        //    pubfun.Alert(Page, "您的主题!");
        //    this.Text5.Focus();
        //    return;
        //}



        ////string tissss = checkStr(Text4.Value.ToString()).ToString().Substring(0, 15);

        //bs.user("Insert into downinfo(title,[name],tel,email,content) values('" + Text5.Value.Replace("'", "") + "','" + Text1.Value.Replace("'", "") + "','" + Text2.Value.Replace("'", "") + "','" + Text3.Value.Replace("'", "") + "','" + Text4.Value.Replace("'", "") + "')");

        //pubfun.Location(Page, "留言提交成功!", Request.Url.AbsoluteUri);


    }


    //截取字符串 显示新闻标题前30字
    public string bangjiequ(string strss, int id)
    {

        if (strss.IndexOf("|") > -1)
        {
            string[] stsszu = strss.Split('|');
            strss = stsszu[0].ToString();
        }


        if (strss.Length > id)
        {
            strss = strss.Substring(0, id);
        }

        return strss;

    }

    //截取字符串  显示新闻内容前100字
    public string bangjiequ22(string strss, int id)
    {

        //自己编写的节造:只能输入--汉字(1)
        string sttsid = "";

        //foreach (char s in strss)
        //{
        //    int i = (int)s;
        //    if (i < 0x4e00 || i > 0x9fa5)
        //    {
        //        //Response.Write("只能输入汉字!");

        //    }
        //    else
        //    {
        //        sttsid = sttsid + s.ToString();
        //    }
        //}


        if (strss.IndexOf("|") > -1)
        {
            string[] ste22sss = strss.Split('|');

            strss = ste22sss[0].ToString();


        }

        sttsid = checkStr(strss);
        if (sttsid.Length > id)
        {
            sttsid = sttsid.Substring(0, id);
        }
        return sttsid;


    }


    public string checkStr(string html)
    {
        System.Text.RegularExpressions.Regex regex1 = new System.Text.RegularExpressions.Regex(@"<script[\s\S]+</script *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        System.Text.RegularExpressions.Regex regex2 = new System.Text.RegularExpressions.Regex(@" href *= *[\s\S]*script *:", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        System.Text.RegularExpressions.Regex regex3 = new System.Text.RegularExpressions.Regex(@" no[\s\S]*=", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        System.Text.RegularExpressions.Regex regex4 = new System.Text.RegularExpressions.Regex(@"<iframe[\s\S]+</iframe *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        System.Text.RegularExpressions.Regex regex5 = new System.Text.RegularExpressions.Regex(@"<frameset[\s\S]+</frameset *>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        System.Text.RegularExpressions.Regex regex6 = new System.Text.RegularExpressions.Regex(@"<img(.*?)src=[""|']?(.*?\.(gif|bmp|png|jpg))[""|']?(.*?)>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        System.Text.RegularExpressions.Regex regex7 = new System.Text.RegularExpressions.Regex(@"</p>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        System.Text.RegularExpressions.Regex regex8 = new System.Text.RegularExpressions.Regex(@"<p>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        System.Text.RegularExpressions.Regex regex9 = new System.Text.RegularExpressions.Regex(@"<[^>]*>", System.Text.RegularExpressions.RegexOptions.IgnoreCase);
        html = regex1.Replace(html, ""); //过滤<script></script>象征
        html = regex2.Replace(html, ""); //过滤href=javascript: (<A>) 属性
        html = regex3.Replace(html, " _disibledevent="); //过滤其它控件的on...事务
        html = regex4.Replace(html, ""); //过滤iframe
        html = regex5.Replace(html, ""); //过滤frameset
        html = regex6.Replace(html, ""); //过滤frameset
        html = regex7.Replace(html, ""); //过滤frameset
        html = regex8.Replace(html, ""); //过滤frameset
        html = regex9.Replace(html, "");
        html = Regex.Replace(html, @"[\n\r]", "");
        html = html.TrimEnd((char[])"\n\r".ToCharArray());

        html = html.Replace(" ", "");
        html = html.Replace(" ", "&nbsp;");
        html = html.Replace("</strong>", "");
        html = html.Replace("<strong>", "");


        html = Regex.Replace(html, @"<script[^>]*?>.*?</script>", "", RegexOptions.IgnoreCase);

        //删除HTML

        html = Regex.Replace(html, @"<(.[^>]*)>", "", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"([\r])[\s]+", "", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"-->", "", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"<!--.*", "", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(quot|#34);", "\"", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(amp|#38);", "&", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(lt|#60);", "<", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(gt|#62);", ">", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(nbsp|#160);", " ", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(iexcl|#161);", "\xa1", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(cent|#162);", "\xa2", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(pound|#163);", "\xa3", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&(copy|#169);", "\xa9", RegexOptions.IgnoreCase);

        html = Regex.Replace(html, @"&#(\d+);", "", RegexOptions.IgnoreCase);

        html.Replace("<", "");

        html.Replace(">", "");

        html.Replace("\r", "");
        html.Replace(" ", "");

        html = HttpContext.Current.Server.HtmlEncode(html).Trim();

        return html;



    }







}


#line default
#line hidden