forum.aspx 论坛主页

<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
1) forum. aspx :- The main forum page

<%@ Page Language="C#" Debug="true" %>
<%@ Assembly Name="System.Data" %>
<%@ Import Namespace="System.Data.ADO" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System" %>
<html><head>
<title>Welcome to My forum!</title>
  <script language="C#" runat="server" >
  //execute this script when the page loads
  void Page_Load(Object Src, EventArgs E)
  {
     //Call the Method to DataBind the DataGrid
     Binding() ;
  }
  //This Method Connects to the Database, and DataBinds the Database to the DataGrid
  public void Binding()
  {
     //String to connect to the database, If your Database is in some other directory then change the path
     //To the Database below  
     string strConn=@"Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="+Server.MapPath(".//db//board.mdb") ;
     //Make a Connection to the Database
     ADOConnection myConn = new ADOConnection(strConn) ;
     //String to select records from the Database. newpost Table
     //I have used "ORDER BY postid DESC" since I want to show the latest post on the top
     //If you remove this clause then the oldest message will be shown first
     string strCom = "SELECT postid ,subject ,name ,replies ,views ,date FROM newpost ORDER BY postid DESC" ;
     //Open the Connection, Always remember to Open the connection before doing anything else
     myConn.Open();
     DataSet myDataSet = new DataSet();
     //Create a ADODataSetCommand and a DataSet
     ADODataSetCommand myCommand =new ADODataSetCommand(strCom,myConn);
     //Fill the DataSet
     myCommand.FillDataSet(myDataSet,"newpost") ;
     //Connection is closed
     myConn.Close();
     //Set the DataView of the Table "newpost" contained in the DataSet for the DataGrid
     DataGrid1.DataSource = myDataSet.Tables["newpost"].DefaultView ;
     //DataBind the DataGrid
     DataGrid1.DataBind();
  }
  //This method is called when the DataGrid is Paged (i.e. when you change from Page 1 to Page 2 etc.. )
  public void DataGrid_Updt(Object sender, DataGridPageChangedEventArgs e)
  {
     //Call the Method to Databind
     Binding();
  }
  //This Method is called when the form is submitted to make a new Post
  public void Submit_Click(Object sender, EventArgs e)
  {
     //proceed only if all the required fields are filled-in
     if(Page.IsValid&&name.Text!=""&&subject.Text!=""&&email.Text!=""){
        //Get the Current Date and Time
        DateTime now = DateTime.Now ;
        errmess.Text="" ;
        //I am building a custom query which will be used to call the postmessage. aspx page.
        //Since it will be a query we have to encode the query into UTF8 format.
        //So I get all the fields from the form and encode them into UTF8 format   
        string req = "name="+ System.Web.HttpUtility.UrlEncodeToString(name.Text, System.Text.Encoding.UTF8);
        req+="&&email="+ System.Web.HttpUtility.UrlEncodeToString(email.Text, System.Text.Encoding.UTF8);
        req+="&&subject="+ System.Web.HttpUtility.UrlEncodeToString(subject.Text, System.Text.Encoding.UTF8);
        //Get the HostAddress of the Author
req+="&&ip="+ System.Web.HttpUtility.UrlEncodeToString(Request.UserHostAddress.ToString(), System.Text.Encoding.UTF8);
        req+="&&date="+ System.Web.HttpUtility.UrlEncodeToString(now.ToString(), System.Text.Encoding.UTF8);
        req+="&&message="+ System.Web.HttpUtility.UrlEncodeToString(message.Text, System.Text.Encoding.UTF8);
        //A 'yes' is used below to tell the postmessage page that this is a new topic post
        req+="&&newpost="+ System.Web.HttpUtility.UrlEncodeToString("yes", System.Text.Encoding.UTF8);
        //call the postmessage. aspx page and append the query to it.
        Page.Navigate("postmessage. aspx?" + req);
      }
      else
      {
         errmess.Text="Fill in all the Required Fields before Posting!<br>" ;
        }
   }
</script>
<LINK href="mystyle.css" type=text/css rel=stylesheet></head>
<body topmargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">
<!-- #Include File="header.inc" -->
<center>
<asp:label id="errmess" text="" style="COLOR:#ff0000" runat="server" />
<asp:Label class=fodark text="<font color=#00000 >Welcome to My Discussion forum</font>" runat=server />
<br>
<br>
<form   method="post" runat="server" ID=Form1>
<%-- The DataGrid settings. Its very interesting how much you can play with it --%>
<asp:DataGrid id=DataGrid1 runat="server" ForeColor="Black"
PagerStyle-Mode="NumericPages"
OnPageIndexChanged="DataGrid_Updt" PageSize="20" AllowPaging="True" width="80%" autogeneratecolumns="False">
<property name="PagerStyle">
<asp:DataGridPagerStyle BackColor="Coral" Mode="NumericPages">
</asp:DataGridPagerStyle>
</property>

<property name="AlternatingItemStyle">
<asp:TableItemStyle BorderColor="#FFC080" BackColor="#FF9966">
</asp:TableItemStyle>
</property>

<property name="FooterStyle">
<asp:TableItemStyle ForeColor="White" BackColor="DarkOrange">
</asp:TableItemStyle>
</property>

<property name="ItemStyle">
<asp:TableItemStyle BackColor="Moccasin">
</asp:TableItemStyle>
</property>

<property name="HeaderStyle">
<asp:TableItemStyle Font-Bold="True" ForeColor="White" BackColor="Coral">
</asp:TableItemStyle>
</property>
<%-- I am setting up the Individual columns myself using Templates --%>
<property name="Columns">
<%-- Manipulate the subject entry so that it contains a link to the reply page --%>
<asp:TemplateColumn HeaderText="Subject" itemstyle-width=50%>
<template name="ItemTemplate" >
<asp:Label runat="server"  Text='<%#"<a href=reply. aspx?postid="+DataBinder.Eval(Container, "DataItem.postid")+">"
        +DataBinder.Eval(Container, "DataItem.subject")+"</a>" %>' ID=Label2></asp:Label>
</template>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="Author Name" itemstyle-width=20%>
<template name="ItemTemplate">
<asp:Label runat="server"  Text='<%# DataBinder.Eval(Container, "DataItem.name") %>' ID=Label3></asp:Label>
</template>
</asp:TemplateColumn>


<asp:TemplateColumn HeaderText="Replies" itemstyle-width=10%>
<template name="ItemTemplate">
<asp:Label runat="server" width=10% Text='<%# DataBinder.Eval(Container, "DataItem.replies") %>' ID=Label4>
</asp:Label>
</template>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="Views" itemstyle-width=10%>
<template name="ItemTemplate">
<asp:Label runat="server" width=10% Text='<%# DataBinder.Eval(Container, "DataItem.views") %>' ID=Label5>
</asp:Label>
</template>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="Date of Post" itemstyle-width=10%>
<template name="ItemTemplate">
<asp:Label runat="server" width=10% Text='
<%# DataBinder.Eval(Container, "DataItem.date").ToString().ToDateTime().ToShortDateString() %>' ID=Label6>
</asp:Label>

</template>
</asp:TemplateColumn>
</property>
</asp:DataGrid>
<br>
<br>
<asp:Label class=fodark text="<font color=#00000 >Post New Topic</font>" runat=server />
<br>
<table border="0"  width="80%" align="center">
<tr >
<td class="fohead" colspan=2><b>Post New Topic</b></td>
</tr>
<tr class="folight" >
<td>Name :</td>
<td ><asp:textbox text="" id="name" runat="server" />   <font color=#ff0000>*</font></td>
</tr>
<tr class="folight">
<td>E-Mail :</td>
<td><asp:textbox text="" id="email" runat="server"/>   <font color=#ff0000>*</font></td>
</tr>
<tr class="folight">
<td> Subject:</td>
<td><asp:textbox test="" id="subject" width=200 runat="server"/>   <font color=#ff0000>*</font>
</td></tr>
<tr class="folight">
<td>Message :</td>
<td>
<asp:TextBox id=message runat="server"
Columns="30" Rows="15" TextMode="MultiLine"></asp:TextBox></td>
</tr>
<tr class=folight>
<td colspan=2>
<asp:Button class=fodark id=write onClick=Submit_Click runat="server" Text="Submit"></asp:Button></td></tr>
</table>
</form>
</center>
<!-- #Include File="footer.inc" -->
</body></html

seover="window.status='正文-- forum. aspx 论坛主页';return true">
<script type="text/javascript"> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
DotWe论坛系统采用C#开发,是目前安全性最强,效率最高,功能最多,界面定制最灵活、最自由的整站系统,后台多达一百多种设置管理功能,所有网页源代码均在后台保存,并可无限增加。完全采用原始代码编写,完全采用手工布局,按处理上亿条数据量的要求进行设计和布局整体架构,按多国语言的发展方向设计目录结构,按绿色环保思维设计文件管理功能。所有用户上传的文件都按时间日期分类存放,删除贴子文章时自动将对应的图片文件删除,保证空间绿色环保。        1.支持域名指向,可以使各种域名指向不同的页面,实现了只用同一个空间放无数个网站的功能,如  http://www.dotwe.com其实是  http://www.9k8.com 在同一个空间同一个目录下。但用不同域名访问得到的页面是不同的。        2.后台有网页管理工具,可以很方便的进行分门别类地管理网页。        3.后台配置了一个WEB资源管理器,可以对文件、目录进行上传、粘贴、复制、删除、编辑、创建、剪切移动等,管理网站基本上就不需要FTP软件了。        4.安全性高达100%,本系统不怕木马和脚本,不仅不怕,还支持、允许用户随意上传木马程序、网页脚本、黑客程序等。        5.水印,上传图时可以加水印,后台可以设置选择文字水印或图片水印,上传bmp图片时系统会自动压缩成jpg格式。        6.管理员权限可以自由定义,自由定义管理员名称和职位        7.回贴时可以加入投票、评论、活动等功,阅读权限,指定阅读者等。        8.每个版块均可自定义界面,VIP用户,博客功能,定时自动开关版块,封锁IP或IP段,黑名单,贵宾,阅读权限        9.后台配置了界面设计和管理功能,所有界面均可在后台在线设计和管理        10.支持两种打分规则,此项规则由站长在后台设置        11.同时支持Access数据库和MSSQL数据库        12.置顶分为:总置顶(全站置顶)?版总置顶(根板块置顶).版内置顶(某板块中置顶)?置顶(当前板块置顶)        13.绿色功能:比如你上传了一些图片,但在发贴时没用上,系统会自动帮你删除,很久以后,管理员把你的贴删除时,系统会自动把这个贴里引用的图删除掉。以保证服务器不会垃圾成山        14.无限建立子分类功能,支持无限建立子类、分类的锁定、Copy、移动......        15.程序与网页100%分离,系统中不含HTML代码,所有代码都在后台的界面管理区里进行统一分类管理,模板中还设有全站共享代码和局部共享代码,很方便设计模板的公用部份。所有模板都可以即时备份、编辑....        16.多种虚拟型像并存(也叫万能虚拟型像系统,是专为游戏中的人物型像设计的),在论坛区、用户区,都内置了调用虚拟型像的功能。        17.权限设置功能,很全面很详尽,并且已成为整个系统的通用规则        ................        功能实在太多了,不能完全写出来。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值