master
editor 12 months ago
commit 267c57f592

@ -0,0 +1,35 @@
NM简单个人博客源码
一、源码描述
      这是一款入门级别的个人博客网站源码,功能相对比较少,比较适合新手
      学习交流使用,有兴趣的朋友可以下载学习一下。 
二、功能介绍
      该源码主要实现了用户的登陆注册、发表文章、留言板、用户管理的功能。
三、注意事项
      1、后台管理员用户名密码均是:51aspx。
      2、开发环境为Visual Studio 2022数据库为SQL Server 2019数据库文件在DB_51aspx
      文件夹中,使用.net 4.0开发。
      3、默认数据库连接字符串在webconfig配置文件中修改。
      4、该源码仅供学习交流使用。
作者: 匿名
如需获得该源码的视频、更新等更多资料请访问: https://www.51aspx.com/Code/XMJianDanBlog
------------------------------------------------------------------------------------------------
源码服务专家
官网: https://www.51aspx.com
讨论圈: https://club.51aspx.com/
平台声明:
1.51Aspx平台上提供下载的资源为免费、共享、商业三类源码,其中免费和共享源码仅供个人学习和研究使用,商业源码请在相应的授权许可条件下使用;
2.51Aspx平台对提供下载的软件及其它资源不拥有任何权利,其版权归属源码合法拥有者所有;
3.著作权人发现本网站载有侵害其合法权益的内容或作品,请与我们联系( 登录官网与客服反馈或发送邮件到support@51Aspx.com
4.51Aspx平台不保证提供的下载资源的准确性、安全性和完整性;
友情提示:
一般数据库文件默认在 DB_51Aspx 文件夹下
默认账号密码一般均为51Aspx
关于源码使用常见问题及解决方案,请参阅: https://www.51aspx.com/Help

@ -0,0 +1,15 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Account_Login" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style2
{
text-align: center;
}
.style3
{
text-align: left;
}
.style4
{
text-align: left;

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class Account_Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}

@ -0,0 +1,15 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="register.aspx.cs" Inherits="Account_register" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style1
{
text-align: center;
}
.style3
{
width: 96px;
}
.style4
{
width: 109px;

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class Account_register : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}

@ -0,0 +1,15 @@
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Text;
using System.Security.Cryptography;//MD5加密需引入的命名空间
using System.Data.SqlClient;//数据库操作需引入的命名空间

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
///MessageBox 的摘要说明
/// </summary>
public class MessageBox
{
public MessageBox()
{
}
//参数TxtMesage 为发送的内容

@ -0,0 +1,15 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Blog/BlogMasterPage.master" AutoEventWireup="true" CodeFile="ArticleManager.aspx.cs" Inherits="Blog_Article" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<p>
<table style="width: 100%; height: 902px;">
<tr>
<td style="text-align: right">
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
style="text-align: right" Text="发表文章" />
</td>
</tr>
<tr>
<td>
<table style="width:70%; height: 870px;">
<tr>

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data;
public partial class Blog_Article : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

@ -0,0 +1,15 @@
<%@ Master Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="BlogMasterPage.master.cs" Inherits="Blog_MasterPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style1
{
width: 135px;
text-align: left;
}
.style2
{
text-align: left;
}
</style>
</asp:Content>

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Blog_MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

@ -0,0 +1,7 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Blog/BlogMasterPage.master" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="Blog_Index" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<p>
欢迎来到本博客</p>
</asp:Content>

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Blog_Index : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

@ -0,0 +1,15 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Blog/BlogMasterPage.master" AutoEventWireup="true" CodeFile="Massage.aspx.cs" Inherits="Blog_Massage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<p style="text-align: left">
<table style="width: 100%;">
<tr>
<td style="height: 178px">
<div style="text-align: left">
<asp:Label ID="Label1" runat="server" Text="评论列表:"></asp:Label>
</div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" Height="208px" Width="802px">
<Columns>
<asp:BoundField DataField="Author" HeaderText="Author"
SortExpression="Author" />

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class Blog_Massage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//DB db = new DB();
//string strSql = "SELECT Subject,Author,Context,Time FROM tb_Revert";

@ -0,0 +1,15 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Blog/BlogMasterPage.master" AutoEventWireup="true" CodeFile="SendArticle.aspx.cs" Inherits="Blog_SendArticle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<p>
<table style="width: 100%; height: 512px;">
<tr>
<td style="text-align: center; height: 58px">
<asp:Label ID="Label1" runat="server" style="font-size: x-large" Text="标题"></asp:Label>
&nbsp;
<asp:TextBox ID="txtboxTitle" runat="server" Height="34px" Width="595px"></asp:TextBox>
</td>
</tr>
<tr>
<td style="height: 417px; text-align: center">
<asp:TextBox ID="txtboxContext" runat="server" Height="391px"

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Blog_SendArticle : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSend_Click(object sender, EventArgs e)
{

@ -0,0 +1,15 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Blog/BlogMasterPage.master" AutoEventWireup="true" CodeFile="ShowArticle.aspx.cs" Inherits="Blog_ShowArticle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<table style="width:100%; height: 360px;">
<tr>
<td style="text-align: center; height: 23px;">
<asp:Label ID="labSubject" runat="server"></asp:Label>
<br />
</td>
</tr>
<tr>
<td style="text-align: center">
<asp:Label ID="labAuthor" runat="server"></asp:Label>
</td>
</tr>

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
public partial class Blog_ShowArticle : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DB db = new DB();

@ -0,0 +1,15 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Blog/BlogMasterPage.master" AutoEventWireup="true" CodeFile="UserManager.aspx.cs" Inherits="Blog_UserManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<p style="text-align: left">
<table style="width: 100%;">
<tr>
<td>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:db_BlogConnectionString %>"
SelectCommand="SELECT [UserName], [ID], [IsAdmin] FROM [tb_User]"
DeleteCommand="DELETE FROM [tb_User] WHERE [UserName] = @UserName"
InsertCommand="INSERT INTO [tb_User] ([UserName], [ID], [IsAdmin]) VALUES (@UserName, @ID, @IsAdmin)"
UpdateCommand="UPDATE [tb_User] SET [ID] = @ID, [IsAdmin] = @IsAdmin WHERE [UserName] = @UserName">
<DeleteParameters>
<asp:Parameter Name="UserName" Type="String" />

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class Blog_UserManager : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}

@ -0,0 +1,15 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Blog/BlogMasterPage.master" AutoEventWireup="true" CodeFile="UserMassage.aspx.cs" Inherits="Blog_UserMassage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<p style="text-align: left">
<table style="width:100%;">
<tr>
<td colspan="2">
<br />
用户信息<br />
</td>
</tr>
<tr>
<td style="width: 214px">
用户ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Data.SqlClient;
public partial class Blog_UserMassage : System.Web.UI.Page
{
//查询本用户信息
protected void Page_Load(object sender, EventArgs e)
{
DB db = new DB();

@ -0,0 +1,15 @@
<%@ Application Language="C#" %>
<script runat="server">
void Application_Start(object sender, EventArgs e)
{
// 在应用程序启动时运行的代码
}
void Application_End(object sender, EventArgs e)
{
// 在应用程序关闭时运行的代码
}

@ -0,0 +1,15 @@
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div style="width: 965px; height: 425px; text-align: right; background-image: url('/MyBlog_use_asp.net/Image/背景图1.jpg');">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label
ID="labUser" runat="server"></asp:Label>

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
public partial class MasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
//在模板页中对session的User变量判断显示出用户名
if (Session["UserName"] != null)
{

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
<add name="db_BlogConnectionString" connectionString="Data Source=.;Initial Catalog=db_Blog;User ID=sa;Password=51Aspx" providerName="System.Data.SqlClient"/>
</connectionStrings>
<appSettings>
<!-- 数据库服务器名 -->
<add key="ConnectionString" value="server=.;Uid=sa;pwd=51Aspx;database=db_Blog;"/>
<!-- 存放该网站的文件夹名 -->
<add key="FileFloderName" value="MyBlog_use_asp.net"/>
Loading…
Cancel
Save