温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:内文广告管理系统V1.1版源码
当前文件:
TextAd/siteUser.aspx.cs,打开代码结构图
TextAd/siteUser.aspx.cs,打开代码结构图1using System; 2
using System.Data; 3
using System.Configuration; 4
using System.Collections; 5
using System.Web; 6
using System.Web.Security; 7
using System.Web.UI; 8
using System.Web.UI.WebControls; 9
using System.Web.UI.WebControls.WebParts; 10
using System.Web.UI.HtmlControls; 11
public partial class siteUser : System.Web.UI.Page 12
{ 13
public string code = "";//广告代码 14
protected void Page_Load(object sender, EventArgs e) 15
{ 16
if (!User.Identity.IsAuthenticated) Response.Redirect("login.aspx");//没有登录则转向登录页面 17
code = "<script type =\"text/javascript\" >var username='"+ User.Identity.Name+"'"; 18
code+= "; </script><script type=\"text/javascript\" src=\"js/getad.js\"></script>"; 19
TextBox1.Text = code; 20
string username = User.Identity.Name;//用户账号 21
Sql s = new Sql(); 22
//获取用户的广告推广数据,显示出来 23
GridView1.DataSource = s.getMyDataSet("select * from hit where username='"+username +"'"); 24
GridView1.DataBind(); 25
} 26
} 27
//该源码下载自www.51aspx.com(51aspx.com)





}
}