資源簡介
博客模塊使用說明書
附加SQL Server 2000數據庫
(1)將App_Data文件夾中的兩個文件拷貝到SQL Server 2000安裝路徑下的Data文件夾中。
(2)打開SQL Server 2000中的“企業管理器”,然后展開本地服務器,在“數據庫”數據項上單擊鼠標右鍵,在彈出的快捷菜單中選擇“所有任務”/“附加數據庫”菜單項。
(3)將彈出“附加數據庫”對話框,在該對話框中單擊“ ”按鈕,選擇所要附加數據庫的.mdf文件,單擊“確定”按鈕,即可完成數據庫的附加操作。
配置IIS
(1)依次選擇“開始”/“設置”/“控制面板”/“管理工具”/“Internet信息服務(IIS)管理器”選項,彈出“Internet信息服務(IIS)管理器”窗口,如圖1.1所示。
圖1.1 “Internet信息服務(IIS)管理器”窗口
(2)選中“默認網站”節點,單擊右鍵,選擇“屬性”,如圖1.2所示。
圖1.2 選擇“屬性”菜單項
(3)彈出“默認網站 屬性”對話框,如圖1.3所示,單擊“網站”選項卡,在“IP地址”下拉列表中選擇本機IP地址。
圖1.3 默認網站 屬性
(4)單擊“主目錄”選項卡,如圖1.4所示。單擊“瀏覽”按鈕,彈出“瀏覽文件夾”對話框,選擇您的網站路徑,單擊【確定】按鈕。
圖1.4 “主目錄”選項頁
(5)選中首頁文件,單擊鼠標右鍵,在彈出的菜單中選擇“瀏覽”菜單項。
使用說明
使用該程序,讀者需要下載:FreeTexBox..dll和URLRewrite.dll(這兩個.dll文件可在微軟官方網站上下載)。粘貼到Bin文件夾下。
運行“BlogIndex.aspx”文件,進入主頁面,如圖1.5所示。在本博客世界中,用戶可注冊自己的博客帳戶,然后添加文章,并將其顯示在博客首頁中。
圖1.5 程序主頁面
單擊用戶登錄處的“注冊”按鈕,注冊博客帳戶,然后進行登錄,進入個人博客管理頁面,如圖1.6所示。在這里可用戶可添加文章及管理文章,還可添加個人通訊錄。
圖1.6 個人博客管理頁面
單擊用戶登錄處的“管理員登錄”超鏈接,進入管理員登錄頁面,如圖1.7所示。輸入管理員密碼mrsoft,及驗證碼,單擊“確定”按鈕,進入后臺主頁面,如圖1.8所示。在后臺,管理員可管理注冊的博客用戶信息、評論信息、留言信息、文章類型等。
圖1.7 管理員登錄頁面
圖1.8 后臺管理主頁面

代碼片段和文件信息
using?System;
using?System.Collections;
using?System.ComponentModel;
using?System.Data;
using?System.Data.SqlClient;
using?System.IO;
using?System.Configuration;
using?System.Drawing;
using?System.Web;
using?System.Web.SessionState;
using?System.Web.UI;
using?System.Web.UI.WebControls;
using?System.Web.UI.HtmlControls;
using?System.Text.Regularexpressions;
public?partial?class?BlogIndex?:?System.Web.UI.Page
{
????protected?System.Web.UI.HtmlControls.HtmlForm?Form1;
????public?string?ST_bgcolor;
????protected?System.Web.UI.WebControls.Calendar?Calendar1;
????public?string?ST_tcolor;
????public?string?loopId;
????public?string?str;
????SqlData?myobj?=?new?SqlData();
????protected?void?Page_Load(object?sender?EventArgs?e)
????{
????????//?在此處放置用戶代碼以初始化頁面
string?ST_cmd_sql?=?“select?top?10?*?from?ST_news?where?ST_n_iscmd=1?order?by?ST_n_date?desc“;
????????????string?ST_top_sql?=?“select?top?10?*?from?ST_news?order?by?ST_n_hit?desc“;
????????????string?personindex?=?“select?top?10*?from?ST_news?order?by?ST_n_id?desc“;
????????????string?titleClass?=?“select?ST_c_id?ST_c_name?from?ST_class?order?by?ST_date?desc“;
????????????DataSet?ST_classds?=?myobj.GetDataSet(titleClass“ST_class“);
????????????DataSet?ST_cmdds?=?myobj.GetDataSet(ST_cmd_sql?“ST_news“);
????????????DataSet?ST_topds?=?myobj.GetDataSet(ST_top_sql?“ST_news“);
????????????DataSet?mypersonds?=?myobj.GetDataSet(personindex?“ST_class“);
????????????//綁定博客文章類型列表
ClassList.DataSource?=?new?DataView(ST_classds.Tables[0]);
ClassList.DataBind();
????????????
????????????//綁定推薦文章列表
CmdList.DataSource?=?new?DataView(ST_cmdds.Tables[0]);
CmdList.DataBind();
????????????//綁定熱點文章列表
????????????TopList.DataSource?=?new?DataView(ST_topds.Tables[0]);
????????????TopList.DataBind();
????????????
????????????
????????????//綁定最新個人最新發表的博客文章
????????????ClassList0.DataSource?=?new?DataView(mypersonds.Tables[0]);
????????????ClassList0.DataBind();
????????????if?(Request.QueryString[“c_id“]?==?null)
????????????{
????????????????person_BindData();
????????????}
????????????else
????????????{
????????????????NewsBlogList_Bind();
????????????}
????????????
if?(Request.Cookies[“colors“]!=null)
{
string?ST_test?=?Request.Cookies[“colors“].Value;
String[]?ST_colorList?=?ST_test.Split(new?char[]?{?‘‘?});
ST_bgcolor?=?ST_colorList[0];
ST_tcolor?=?ST_colorList[1];
}
else
{
ST_bgcolor?=?“#FFFFFF“;
ST_tcolor?=?“#cccccc“;
}
Page.DataBind();
????????????string?rd?=?DateTime.Now.Ticks.ToString();
????????????str?=?“imgFile/1.jpg?rd=“?+?rd?+?“|imgFile/2.jpg?rd=“?+?rd?+?“|imgFile/3.jpg?rd=“?+?rd?+?“|imgFile/4.jpg?rd=“?+?rd?+?““;
????????????string?path?=?Server.MapPath(“./“)?+?“imgFile/LoopId.txt“;
????????????loopId?=?File.ReadAllText(path);
????????????loopId?=?loopId.Replace(‘‘?‘|‘);
}
public?void?ST_get_Replay()
{
Response.Write?(“
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2102??2006-08-14?18:44??02\myBlog\App_Code\AssemblyInfo.cs
?????文件???????6072??2008-09-06?15:21??02\myBlog\App_Code\ItemOperation.cs
?????文件???????4421??2008-08-04?19:11??02\myBlog\App_Code\SqlData.cs
?????文件???????1646??2008-06-19?19:04??02\myBlog\App_Code\UserInfo.cs
?????文件???????2514??2008-06-19?18:30??02\myBlog\App_Code\User_picture.cs
?????文件????2490368??2009-07-11?08:34??02\myBlog\App_Data\db_Blog_Data.MDF
?????文件????1048576??2009-07-11?08:34??02\myBlog\App_Data\db_Blog_Log.LDF
?????文件??????46273??2005-11-08?20:10??02\myBlog\aspnet_client\FreeTextBox\FTB-FreeTextBox.js
?????文件???????9364??2005-01-27?14:25??02\myBlog\aspnet_client\FreeTextBox\FTB-ImageGallery.js
?????文件??????92844??2006-01-07?19:21??02\myBlog\aspnet_client\FreeTextBox\FTB-Pro.js
?????文件???????3371??2005-05-17?21:03??02\myBlog\aspnet_client\FreeTextBox\FTB-ToolbarItems.js
?????文件???????7554??2005-08-02?20:27??02\myBlog\aspnet_client\FreeTextBox\FTB-Utility.js
?????文件????????865??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\bold.gif
?????文件????????138??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\bulletedlist.gif
?????文件???????7128??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\buttons.gif
?????文件???????8340??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\buttons.png
?????文件????????373??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\copy.gif
?????文件????????429??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\createlink.gif
?????文件????????140??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\csharp.gif
?????文件?????????43??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\css\toolbarbutton.off.out.gif
?????文件????????266??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\css\toolbarbutton.off.over.gif
?????文件????????266??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\css\toolbarbutton.on.out.gif
?????文件????????266??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\css\toolbarbutton.on.over.gif
?????文件????????148??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\css\toolbarbutton.over.gif
?????文件????????342??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\cut.gif
?????文件????????234??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\delete.gif
?????文件????????331??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\deletetablecolumn.gif
?????文件????????344??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\deletetablerow.gif
?????文件????????599??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\editstyle.gif
?????文件????????632??2005-02-28?08:36??02\myBlog\aspnet_client\FreeTextBox\images\edittable.gif
............此處省略834個文件信息
評論
共有 條評論
相關資源