`
阅读更多

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 System.Data.SqlClient;
using System.Text;

namespace domain.UI.News.Controls
{
    public partial class NewsShow : System.Web.UI.UserControl
    {
        private domain.SQLDB.DbAccess _db;
        private string _outModel;
        private string _inModel;
        private string _columns;
        private string _sql;
        private string _split;
        private string _firstModel;
        private string _firstColumn;
 
        public domain.SQLDB.DbAccess Db
        {
            set { this._db = value; }
            get { return this._db; }
        }
        public string Sql
        {
            set { this._sql = value; }
            get {
                if (string.IsNullOrEmpty(_sql))
                    _sql = "";
                return this._sql; }
        }
        public string OutModel
        {
            set { this._outModel = value; }
            get {
                if (string.IsNullOrEmpty(_outModel))
                    _outModel = "";
                return this._outModel; }
        }
        public string InModel
        {
            set { this._inModel = value; }
            get {
                if (string.IsNullOrEmpty(_inModel))
                    _inModel = "";
                return this._inModel; }
        }
        public string Columns
        {
            set { this._columns = value; }
            get {
                if (string.IsNullOrEmpty(_columns))
                    _columns = "";
                return this._columns; }
        }
        public string Split
        {
            set { this._split = value; }
            get
            {
                if (string.IsNullOrEmpty(_split))
                    _split = "";
                return this._split;
            }
        }
        public string FirstModel
        {
            set { this._firstModel = value; }
            get
            {
                if (string.IsNullOrEmpty(_firstModel))
                    _firstModel = "";
                return this._firstModel;
            }
        }
        public string FirstColumn
        {
            set { this._firstColumn = value; }
            get
            {
                if (string.IsNullOrEmpty(_firstColumn))
                    _firstColumn = "";
                return this._firstColumn;
            }
        }
       
       
   
        protected void Page_Load(object sender, EventArgs e)
        {
        
        }
        public string getTableData()
        {
            System.Text.StringBuilder tempSb = new System.Text.StringBuilder("");
            if (FirstModel.Length > 0)
             goto HasFirst;
            else
             goto NoFirst;

                HasFirst:
                {
                    string[] columns = Columns.Split(',');
                    DataTable dt = new DbAccess().GetTable(Sql);
                   
                    if (dt != null)
                    {
                        for (int j = 0; j < dt.Rows.Count;j++)
                        {
                            if (j == 0)
                            {
                                columns = FirstColumn.Split(',');
                                DataRow dr = dt.Rows[j];
                                string[] tempStr = new string[columns.Length];
                                for (int i = 0; i < tempStr.Length; i++)
                                {
                                    tempStr[i] = Convert.ToString(dr[columns[i]]);
                                }
                                tempSb.AppendFormat(FirstModel,tempStr).Append(_split);
                            }
                            else
                            {
                                DataRow dr = dt.Rows[j];
                                string[] tempStr = new string[columns.Length];
                                for (int i = 0; i < tempStr.Length; i++)
                                {
                                    tempStr[i] = Convert.ToString(dr[columns[i]]);
                                }
                                tempSb.AppendFormat(InModel, tempStr).Append(_split);
                            }
                         
                        }
                    }
                }
                NoFirst: {
                string[] columns = Columns.Split(',');
                DataTable dt = new DbAccess().GetTable(Sql);
             
                if (dt != null)
                {
                    foreach (DataRow dr in dt.Rows)
                    {

                       string[] tempStr = new string[columns.Length];
                        for (int i = 0; i < tempStr.Length; i++)
                        {
                            tempStr[i] = Convert.ToString(dr[columns[i]]);
                        }

                       tempSb.AppendFormat(InModel, tempStr).Append(_split);
                    }
                }
                }

            return OutModel.Length > 0 ? (string.Format(OutModel, (tempSb.Length > 0 ? (tempSb.Remove(tempSb.Length - Split.Length, Split.Length).ToString()) : (tempSb.ToString())))) : (tempSb.Length > 0 ? (tempSb.Remove(tempSb.Length - Split.Length, Split.Length).ToString()) : (tempSb.ToString()));

        }
    }

    public class DbAccess
    {
        SqlConnection conn = null;
        SqlCommand cmd = null;
        public DbAccess()
        {
            //
            // TODO: 在此处添加构造函数逻辑
            //
            conn = new SqlConnection();
            conn.ConnectionString = Convert.ToString(System.Configuration.ConfigurationSettings.AppSettings["datasource"]);           
            cmd = new SqlCommand();
            cmd.Connection = conn;
            cmd.CommandTimeout = 0;

        }
        public DbAccess(string constr)
        {

            //
            // TODO: 在此处添加构造函数逻辑
            //
            conn = new SqlConnection();
            conn.ConnectionString = constr;// "initial catalog=idyan_new;data source=.;user id=bt;password=btbtbtbt";
            cmd = new SqlCommand();
            cmd.Connection = conn;
            cmd.CommandTimeout = 0;

        }
        /// <summary>
        /// 获取数据根据sql语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public DataTable GetTable(string sql)
        {
            DataSet ds = new DataSet();
            try
            {
                cmd.CommandText = sql;
                cmd.CommandType = CommandType.Text;
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = cmd;
                da.Fill(ds);
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;

            }
            return ds.Tables[0] ?? new DataTable();
        }
        /// <summary>
        /// 获取数据根据sql语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public DataSet GetDataSet(string sql)
        {
            DataSet ds = new DataSet();

            try
            {
                cmd.CommandText = sql;
                cmd.CommandType = CommandType.Text;
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = cmd;

                da.Fill(ds);
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;

            }
            return ds;
        }
        /// <summary>
        /// 获取数据根据sql语句
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public DataSet GetDataSet(string sql, SqlParameter[] pas)
        {
            DataSet ds = new DataSet();

            try
            {
                cmd.Parameters.Clear();
                cmd.CommandText = sql;
                foreach (SqlParameter pa in pas)
                {
                    cmd.Parameters.Add(pa);
                }
                cmd.CommandType = CommandType.Text;
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = cmd;

                da.Fill(ds);
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;

            }
            return ds;
        }
        /// <summary>
        /// 获取数据根据sql语句 带参数 的
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="pas"></param>
        /// <returns></returns>
        public DataTable GetTable(string sql, params SqlParameter[] pas)
        {
            DataSet ds = new DataSet();
            try
            {
                cmd.CommandText = sql;
                cmd.CommandType = CommandType.Text;
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = cmd;
                cmd.Parameters.Clear();

                foreach (SqlParameter temppa in pas)
                {
                    cmd.Parameters.Add(temppa);
                }


                da.Fill(ds);
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;
            }
            return ds.Tables[0] ?? new DataTable();
        }
        /// <summary>
        /// 获取数据根据sql语句 带参数 的
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="pas"></param>
        /// <returns></returns>
        public DataTable GetProcTable(string procname, params SqlParameter[] pas)
        {
            DataSet ds = new DataSet();
            try
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = procname;
                //cmd.CommandText = sql;
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = cmd;
                cmd.Parameters.Clear();

                foreach (SqlParameter temppa in pas)
                {
                    cmd.Parameters.Add(temppa);
                }

 

                da.Fill(ds);
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;
            }
            return ds.Tables[0] ?? new DataTable();
        }
        /// <summary>
        /// 获取数据根据sql语句 带参数 的
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="pas"></param>
        /// <returns></returns>
        public DataTable GetProcCursorTable(string procname, params SqlParameter[] pas)
        {
            DataSet ds = new DataSet();
            try
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = procname;
                //cmd.CommandText = sql;
                SqlDataAdapter da = new SqlDataAdapter();
                da.SelectCommand = cmd;
                cmd.Parameters.Clear();

                foreach (SqlParameter temppa in pas)
                {
                    cmd.Parameters.Add(temppa);
                }

 

                da.Fill(ds);
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;
            }
            return ds.Tables[1] ?? new DataTable();
        }
        /// <summary>
        /// 获取数据根据sql语句 带参数 的
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="pas"></param>
        /// <returns></returns>
        public int GetProcState(string procname, params SqlParameter[] pas)
        {
            int state = 0;
            try
            {
                OpenConn();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = procname;
                cmd.Parameters.Clear();
                foreach (SqlParameter temppa in pas)
                {
                    cmd.Parameters.Add(temppa);
                }
                cmd.ExecuteNonQuery();
                CloseConn();
                state = Convert.ToInt32(pas[pas.Length - 1].Value);

            }
            catch
            {
                return 0;
            }
            return state;
        }
        /// <summary>
        /// 获取数据根据sql语句 带参数 的
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="pas"></param>
        /// <returns></returns>
        public int GetProcStateNo(string procname, params SqlParameter[] pas)
        {
            int state = 0;
            try
            {
                OpenConn();
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = procname;
                cmd.Parameters.Clear();
                foreach (SqlParameter temppa in pas)
                {
                    cmd.Parameters.Add(temppa);
                }
                cmd.ExecuteNonQuery();
                CloseConn();
                state = 1;
             

            }
            catch (Exception ex)
            {

                return 0;
            }
            return state;
        }
        /// <summary>
        /// 根据sql语句返回跟新状态
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public bool GetState(string sql)
        {
            bool succ = false;
            try
            {
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sql;
                OpenConn();
                succ = cmd.ExecuteNonQuery() > 0 ? (true) : (false);
                CloseConn();
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return false;
            }
            return succ;

        }
        /// <summary>
        /// 根据sql语句返回跟新状态带参数的
        /// </summary>
        /// <param name="sql">sql语句</param>
        /// <param name="pas">参数的集合</param>
        /// <returns></returns>
        public bool GetState(string sql, params SqlParameter[] pas)
        {
            bool succ = false;
            try
            {
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sql;
                cmd.Parameters.Clear();

                foreach (SqlParameter temppa in pas)
                {
                    cmd.Parameters.Add(temppa);
                }
                OpenConn();
                succ = cmd.ExecuteNonQuery() > 0 ? (true) : (false);
                CloseConn();
            }
            catch (Exception ex)
            {             
                return false;
            }
            return succ;

        }
        /// <summary>
        /// 根据sql语句返回第一个单元格的数据
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public string GetOne(string sql)
        {
            string res = "";
            try
            {
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sql;
                OpenConn();
                res = cmd.ExecuteScalar() == null ? ("") : (Convert.ToString(cmd.ExecuteScalar()));
                CloseConn();
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;
            }
            return res;
        }
        /// <summary>
        ///  根据sql语句返回第一个单元格的数据带参数的
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="pas"></param>
        /// <returns></returns>
        public string GetOne(string sql, params SqlParameter[] pas)
        {
            string res = "";
            try
            {
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = sql;
                cmd.Parameters.Clear();

                foreach (SqlParameter temppa in pas)
                {
                    cmd.Parameters.Add(temppa);
                }
                OpenConn();
                res = cmd.ExecuteScalar() == null ? ("") : (Convert.ToString(cmd.ExecuteScalar()));
                CloseConn();
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;
            }
            return res;
        }
        /// <summary>
        /// 返回数据的DataReader
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        public SqlDataReader GetDataReader(string sql)
        {
            SqlDataReader dr = null;
            try
            {
                cmd.CommandType = CommandType.Text;
                conn.Open();
                cmd.CommandText = sql;
                dr = cmd.ExecuteReader();
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;
            }
            return dr;
        }
        /// <summary>
        /// 返回数据的DataReader带参数的
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="pas"></param>
        /// <returns></returns>
        public SqlDataReader GetDataReader(string sql, params SqlParameter[] pas)
        {
            SqlDataReader dr = null;
            try
            {
                cmd.CommandType = CommandType.Text;
                conn.Open();
                cmd.Parameters.Clear();

                foreach (SqlParameter temppa in pas)
                {
                    cmd.Parameters.Add(temppa);
                }

                cmd.CommandText = sql;
                dr = cmd.ExecuteReader();
            }
            catch (Exception ex)
            {

                this.ShowError(ex.Message);
                return null;
            }
            return dr;
        }
        /// <summary>
        /// 事务处理函数
        /// </summary>
        /// <param name="al"></param>
        /// <returns></returns>
        public bool GetTranState(ArrayList al)
        {
            cmd.CommandType = CommandType.Text;
            OpenConn();
            SqlTransaction tran = conn.BeginTransaction();
            cmd.Transaction = tran;
            try
            {
                for (int i = 0; i < al.Count; i++)
                {
                    cmd.CommandText = Convert.ToString(al[i]);
                    cmd.ExecuteNonQuery();
                }

                tran.Commit();
                CloseConn();
            }
            catch (Exception ex)
            {

                tran.Rollback();
                return false;
            }
            return true;

        }
        /// <summary>
        /// 事务处理函数
        /// </summary>
        /// <param name="al"></param>
        /// <returns></returns>
        public bool GetTranStateParameter(ArrayList al)
        {
            cmd.CommandType = CommandType.Text;
            OpenConn();
            SqlTransaction tran = conn.BeginTransaction();
            cmd.Transaction = tran;
            try
            {
                for (int i = 0; i < al.Count; i++)
                {
                    SqlTranModel stm = (SqlTranModel)al[i];
                    cmd.CommandText = Convert.ToString(stm.Sql);
                    SqlParameter[] pas = stm.Pas;
                    cmd.Parameters.Clear();
                    foreach (SqlParameter temp in pas)
                    {
                        cmd.Parameters.Add(temp);
                    }
                    cmd.ExecuteNonQuery();
                }

                tran.Commit();
                CloseConn();
            }
            catch (Exception ex)
            {

                tran.Rollback();
                return false;
            }
            return true;

        }
        /// <summary>
        /// 分页函数
        /// </summary>
        /// <param name="pagesize"></param>
        /// <param name="columns"></param>
        /// <param name="tablename"></param>
        /// <param name="pid"></param>
        /// <param name="order"></param>
        /// <param name="current"></param>
        /// <returns></returns>
        public DataTable GetPageData(int current, int pagesize, string columns, string tablename, string pid, string where, string order)
        {
            current = current - 1 >= 0 ? (current - 1) : (0);
            string sql = string.Format("select top {0} {1} from {2} where 1=1 and {3} not in(select top {4}{3} from {2} where 1=1{5}  order by {6}){5} order by {6}", pagesize, columns, tablename, pid, current * pagesize, where, order);
            return GetTable(sql);
        }
        /// <summary>
        /// 分页存储过程的调用
        /// </summary>
        /// <param name="current"></param>
        /// <param name="pagesize"></param>
        /// <param name="columns"></param>
        /// <param name="tablename"></param>
        /// <param name="pid"></param>
        /// <param name="where"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        public DataTable GetProcPageData(int current, int pagesize, string columns, string tablename, string pid, string where, string order, string ordertype)
        {
            SqlParameter[] pas = { new SqlParameter("@PageIndex", current), new SqlParameter("@PageSize", pagesize), new SqlParameter("@Columns", columns), new SqlParameter("@Tablename", tablename), new SqlParameter("@Where", where), new SqlParameter("@Order", order), new SqlParameter("@OrderType", ordertype), new SqlParameter("@Pid", pid) };
            return GetProcTable("Pages", pas);
     
        }
        /// <summary>
        /// 分页存储过程的调用
        /// </summary>
        /// <param name="current"></param>
        /// <param name="pagesize"></param>
        /// <param name="columns"></param>
        /// <param name="tablename"></param>
        /// <param name="pid"></param>
        /// <param name="where"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        public DataTable GetProcData(int current, int pagesize, string columns, string tablename, string pid, string where, string order, string resultCount, string distinct)
        {
            SqlParameter[] pas = { new SqlParameter("@TableNames", SqlDbType.NVarChar, 200), new SqlParameter("@PrimaryKey", SqlDbType.NVarChar, 100), new SqlParameter("@Order", SqlDbType.NVarChar, 200), new SqlParameter("@CurrentPage", SqlDbType.Int), new SqlParameter("@PageSize", SqlDbType.Int), new SqlParameter("@Fields", SqlDbType.NVarChar, 800), new SqlParameter("@Filter", SqlDbType.NVarChar, 1000), new SqlParameter("@ResultCount", SqlDbType.NVarChar, 12), new SqlParameter("@distinct", SqlDbType.NVarChar, 12) };
            pas[0].Value = tablename;
            pas[1].Value = pid;
            pas[2].Value = order;
            pas[3].Value = current;
            pas[4].Value = pagesize;
            pas[5].Value = columns;
            pas[6].Value = where;
            pas[7].Value = resultCount;
            pas[8].Value = distinct;
            return this.GetProcTable("Pages", pas);
       
        }
        /// <summary>
        /// 分页存储过程的调用
        /// </summary>
        /// <param name="current"></param>
        /// <param name="pagesize"></param>
        /// <param name="columns"></param>
        /// <param name="tablename"></param>
        /// <param name="pid"></param>
        /// <param name="where"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        public DataTable GetProcAdminData(int current, int pagesize, string columns, string tablename, string pid, string where, string order, string resultCount, string distinct)
        {
            SqlParameter[] pas = { new SqlParameter("@TableNames", SqlDbType.NVarChar, 200), new SqlParameter("@PrimaryKey", SqlDbType.NVarChar, 100), new SqlParameter("@Order", SqlDbType.NVarChar, 200), new SqlParameter("@CurrentPage", SqlDbType.Int), new SqlParameter("@PageSize", SqlDbType.Int), new SqlParameter("@Fields", SqlDbType.NVarChar, 800), new SqlParameter("@Filter", SqlDbType.NVarChar, 200), new SqlParameter("@ResultCount", SqlDbType.NVarChar, 24), new SqlParameter("@Distinct", SqlDbType.NVarChar, 12) };
            pas[0].Value = tablename;
            pas[1].Value = pid;
            pas[2].Value = order;
            pas[3].Value = current;
            pas[4].Value = pagesize;
            pas[5].Value = columns;
            pas[6].Value = where;
            pas[7].Value = resultCount;
            pas[8].Value = distinct;
            return this.GetProcTable("Pages", pas);

        }
        /// <summary>
        /// 打开连接
        /// </summary>
        public void OpenConn()
        {
            if (conn.State != ConnectionState.Open)
            {
                try
                {
                    conn.Open();
                }
                catch (Exception ex)
                {

                    this.ShowError(ex.Message);
                    return;
                }
            }
        }
        /// <summary>
        /// 关闭连接
        /// </summary>
        public void CloseConn()
        {
            if (conn.State != ConnectionState.Closed)
            {
                try
                {
                    conn.Close();

                }
                catch (Exception ex)
                {

                    this.ShowError(ex.Message);
                    return;
                }
            }
        }
        public void DisposeConn()
        {
            try
            {
                if (conn.State != ConnectionState.Closed)
                {
                    try
                    {
                        conn.Close();

                    }
                    catch (Exception ex)
                    {

                        this.ShowError(ex.Message);
                        return;
                    }
                }
            }
            catch
            {

            }
        }

        /// <summary>
        /// 弹出错误的信息
        /// </summary>
        /// <param name="err"></param>
        public void ShowError(string err)
        {
            //  System.Web..Current.Response.Write(Script(err, ""));
        }
        /// <summary>
        /// 显示信息
        /// </summary>
        /// <param name="err"></param>
        public void ShowMessage(string mes, string loc)
        {
            // System.Web.HttpContext.Current.Response.Write(Script(mes, loc));
        }
        /// <summary>
        /// javascript脚本
        /// </summary>
        /// <param name="mess"></param>
        /// <param name="loc"></param>
        /// <returns></returns>
        public string Script(string mess, string loc)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<script language='javascript'>");
            sb.Append("alert('");
            sb.Append(mess);
            sb.Append("');");
            sb.Append(loc);
            sb.Append("</script>");
            return sb.ToString();

        }
        /// <summary>
        /// 弹出错误的信息
        /// </summary>
        /// <param name="err"></param>
        public static void ShowErrorstatic(string err)
        {
            // System.Web.HttpContext.Current.Response.Write(DbAccess.Scriptstatic(err, ""));
        }
        /// <summary>
        /// 显示信息
        /// </summary>
        /// <param name="err"></param>
        public static void ShowMessagestatic(string mes, string loc)
        {
            //System.Web.HttpContext.Current.Response.Write(DbAccess.Scriptstatic(mes, loc));
        }
        //<summary>
        //javascript脚本
        //</summary>
        //<param name="mess"></param>
        //<param name="loc"></param>
        //<returns></returns>
        public static string Scriptstatic(string mess, string loc)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<script language='javascript'>");
            sb.Append("alert('");
            sb.Append(mess);
            sb.Append("');");
            sb.Append(loc);
            sb.Append("</script>");
            return sb.ToString();

        }
    }
    public class SqlTranModel
    {
        private string _sql;
        public string Sql
        {
            set { this._sql = value; }
            get { return this._sql; }
        }
        private SqlParameter[] _pas;
        public SqlParameter[] Pas
        {
            set { this._pas = value; }
            get { return this._pas; }
        }
    }
}

分享到:
评论

相关推荐

    android指定(上或者下)方向的新闻显示控件

    这是我自己写的一个控件,继承自View,然后根据传入的List对象,指定方向,循环向上或者向下显示的新闻滚动控件: 用法:需要在xml布局文件中指定一个LinearLayout或者与之同级的布局,在代码中获取到他,然后在代码...

    新闻列表控件+新闻控件+幻灯片控件示例

    2、各控件默认样式显示时机的改进 2011-5-11 1、新闻列表控件新增内容过滤功能 2、新闻列表控件新增列表滚动功能 2011-5-13 1、改进新闻列表控件结构 2、改进列表滚动功能,新增上下左右滚动功能,支持文字、图片...

    FLASH 图片新闻控件

    6. **响应式设计**:考虑到不同设备的屏幕尺寸,好的Flash图片新闻控件会具备一定的响应式能力,确保在手机和平板电脑上也能正常显示。 【使用方法.txt】文件可能包含了如何在网页中集成和配置这个Flash图片新闻...

    RSS新闻阅读控件及程序

    RSS新闻阅读控件是UI(用户界面)组件,它提供了一种友好的方式来显示和管理RSS订阅。这类控件通常包括搜索、订阅、浏览和管理新闻源的功能。通过使用“控件使用类”,开发者可以轻松地将RSS阅读功能整合到自己的...

    新闻列表分页控件ASP.NET

    【新闻列表分页控件ASP.NET】是一种在ASP.NET Web应用程序中实现数据列表高效分页的方法。这个控件能够帮助开发者在网页上展示大量数据时,有效地管理显示内容,提高用户体验,避免一次性加载过多信息导致页面加载...

    一个新闻轮换控件源码

    这个新闻轮换控件能在网页上的同一个地方显示几条新闻。新闻被拆开几页,为了放置在一个指定的区域。每一页也能包含一对新闻列表。 通过点击底部的页码,能够在不同的页面之间导航,点击页的每个新闻项,就能查看...

    asp.net控件新闻图片轮换等

    标题“asp.net控件新闻图片轮换等”提及的控件,显然涉及到一种用于网站设计的功能,即新闻图片轮换效果。这种效果常见于首页,用来展示最新、最吸引人的新闻或活动,通过自动切换图片来吸引用户的注意力。 在ASP...

    一个新闻轮换控件源码.zip

    在新闻轮换控件中,这些效果可能应用在新闻项的显示和隐藏过程中,如淡入淡出、左右滑动等。 - **响应式设计**:为了适应不同设备和屏幕尺寸,新闻轮换控件通常需要具有响应式布局。这可能通过媒体查询(media ...

    一个新闻/广告轮换控件源码

    这个新闻轮换控件能在网页上的同一个地方显示几条新闻。新闻被拆开几页,为了放置在一个指定的区域。每一页也能包含一对新闻列表。 通过点击底部的页码,能够在不同的页面之间导航,点击页的每个新闻项,就能查看...

    一个基于ASP.Net and C#是实现的Scrolling News 动态新闻消息滚动显示控件代码

    例如,我们可以设置定时器,每隔一定时间自动改变新闻显示的内容。 7. 响应式设计:为了让Scrolling News在不同设备上都能良好显示,需要考虑响应式布局。通过媒体查询(Media Queries)和适当的CSS布局,确保在...

    新闻编辑控件,支持图片、视频上传

    一个功能强大的编辑控件,支持图片、视频上传,文字处理,保存数据库是以html代码的形式保存,读取显示,运用简单,其中包含各个语言的样例,asp.net jsp php ,我只用过asp.net,很好用,所以跟大家分享一下

    QML之Text控件实现信息滚动显示

    总之,通过QML的Text控件和动画系统,我们可以轻松创建具有信息滚动效果的用户界面,这在许多应用中都很常见,如通知提示、滚动新闻条等。理解这些基础原理和技巧,将有助于开发出更加生动和互动的QML应用。

    滚动新闻控件的ASP

    通过这种方式,我们可以创建一个动态的、易于维护的滚动新闻控件,它能够自动从数据库中获取并显示新闻,同时提供友好的用户交互体验。在实际项目中,还可以根据需求对样式、滚动速度、显示数量等进行定制,以满足...

    RSS 新闻阅读控件及程序

    【RSS新闻阅读控件及程序】是一个基于Rss2.0规范开发的组件,主要用于帮助用户轻松地在DELPHI编程环境下实现RSS新闻的获取和展示。RSS(Really Simple Syndication)是一种网络内容发布和聚合的标准,使得用户可以...

    简单的新闻列表显示页gridview

    【标题解析】:“简单的新闻列表显示页gridview”这一标题表明我们要探讨的是如何在ASP.NET环境中使用GridView控件来创建一个基本的新闻列表展示页面。GridView是ASP.NET Web Forms中的一个重要控件,常用于显示数据...

    ASP.NET项目实训:“新闻发布系统”新闻浏览--新闻显示列表.ppt

    * * * * * * * * * * * * “新闻发布系统”新闻浏览 --新闻显示列表 情景分析 由于新闻在首页按照分类进行了显示,这样使得新闻显示和管理更加规范。对于每一类新闻,我们可能需要浏览更多的新闻,这样就需要有一个...

    网易新闻分页控件

    网易新闻首页分页控件显示,右上角按钮 进入频道管理,可编辑删除改变位置

    Android从网络加载图片并显示在ImageView控件上

    在Android开发中,将网络上的图片加载到ImageView控件上是一项常见的需求,特别是在构建社交应用、电商应用或者新闻阅读类应用时。这个过程涉及到多个关键知识点,包括网络请求、图片缓存策略、线程管理以及UI更新等...

    滚动新闻控件 ASP.NET与C#实现(包含原代码)

    控件的核心是一个HTML表格,用来显示新闻的概览。源代码中的`&lt;TABLE&gt;`元素包含一个`&lt;TR&gt;`元素,这些元素在运行时会被填充动态获取的新闻数据。 当页面加载时,`Page_Load`事件处理程序被触发。在这里,通过C#代码...

Global site tag (gtag.js) - Google Analytics