• 大小: 11.18MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-29
  • 语言: 其他
  • 标签: 微博  .net  

资源简介

这是一个基于MVC三层架构的微博系统,很适合毕业设计,功能齐全的系统。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using miroblog.Entity;
namespace miroblog.DBTask
{
   public class sqltask
    {
        private string SQL_getUser = “select * from users where account=@account“;
        private string SQL_getUser_ID = “select * from users where ID=@id“;
        private string SQL_insertMessages = “INSERT INTO Messages(BodyWriteTimeUserIDReferenceID) VALUES(@Body@WriteTime@UserID@ReferenceID)“;
        private string SQL_UpdateFace = “update users set face=@face where id=@userID“;
        private string SQL_selectFollowerID = “select followerID from followers where userID=@userID“;
        private string SQL_selectFollowingID = “select userID  from followers where followerID=@userID“;
      /// 
      /// 判断用户名是否可用
      /// 

      /// 
       public bool RefreshByAccount(string Account)
        {
            using (SqlConnection connection = this.CreateConnection())
            {
                SqlCommand command = connection.CreateCommand();
                command.CommandText = “SELECT IDAccountNamePasswordGenderBirthdayPlaceResumeFace FROM Users WHERE Account=@Account“;
                command.Parameters.AddWithValue(“@Account“ Account);

                connection.Open();
                using (SqlDataReader reader = command.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
            }
            }
       /// 
        /// 根据account查找用户
        /// 

        /// 用户ID
        /// 如果查询成功返回对于的 user对象,否则返回空
        public user getUser(int userID)
        {
            //用连接方式访问数据库
            SqlConnection conn = this.CreateConnection();
            SqlCommand cmd = new SqlCommand(SQL_getUser_ID conn);
            cmd.Parameters.Add(“@id“ System.Data.SqlDbType.Int).Value = userID;
            try
            {
                conn.Open();
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    user user = new user();
                    user.ID = Convert.ToInt16(dr[“ID“]);
                    user.Account = dr.GetString(1);
                    user.Password = dr.GetString(2);
                    user.Name = dr.GetString(3);
                    user.Sex = dr.GetString(4);
                    user.Birthday = Convert.ToDateTime(dr[“Birthday“]);//注意
                    user.Place = dr.GetString(6);
                    user.Resume = dr.GetString(7);
                    user.Face = dr.GetString(8);
                    return user;
         

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2763  2013-06-03 11:18  Micro-blogSystem\miroblog\Backup\DBTask\DBTask.csproj

     文件       1416  2013-05-31 10:55  Micro-blogSystem\miroblog\Backup\DBTask\Properties\AssemblyInfo.cs

     文件      13261  2013-06-12 17:15  Micro-blogSystem\miroblog\Backup\DBTask\sqltask.cs

     文件       2542  2013-05-31 12:07  Micro-blogSystem\miroblog\Backup\Entity\Entity.csproj

     文件        892  2013-06-05 17:14  Micro-blogSystem\miroblog\Backup\Entity\message.cs

     文件       1416  2013-05-31 10:55  Micro-blogSystem\miroblog\Backup\Entity\Properties\AssemblyInfo.cs

     文件       2223  2013-06-08 20:28  Micro-blogSystem\miroblog\Backup\Entity\user.cs

     文件        636  2010-07-16 11:48  Micro-blogSystem\miroblog\Backup\HTMLUI\css\common.css

     文件        989  2010-07-23 14:47  Micro-blogSystem\miroblog\Backup\HTMLUI\css\login.css

     文件       3538  2013-06-10 19:31  Micro-blogSystem\miroblog\Backup\HTMLUI\css\page.css

     文件        800  2010-07-23 15:15  Micro-blogSystem\miroblog\Backup\HTMLUI\css\register.css

     文件       5833  2010-07-16 12:04  Micro-blogSystem\miroblog\Backup\HTMLUI\face.htm

     文件       7576  2010-07-16 11:52  Micro-blogSystem\miroblog\Backup\HTMLUI\herhome.htm

     文件       5001  2013-06-07 21:44  Micro-blogSystem\miroblog\Backup\HTMLUI\HTMLUI.csproj

     文件       1216  2013-06-07 21:44  Micro-blogSystem\miroblog\Backup\HTMLUI\HTMLUI.csproj.user

     文件      12084  2002-11-25 15:43  Micro-blogSystem\miroblog\Backup\HTMLUI\images\1.jpg

     文件       8595  2003-03-29 06:06  Micro-blogSystem\miroblog\Backup\HTMLUI\images\1.png

     文件      12065  2002-11-25 15:43  Micro-blogSystem\miroblog\Backup\HTMLUI\images\2.jpg

     文件       6450  2003-03-29 06:06  Micro-blogSystem\miroblog\Backup\HTMLUI\images\2.png

     文件       2905  2010-07-15 13:05  Micro-blogSystem\miroblog\Backup\HTMLUI\images\bg.png

     文件       3077  2010-07-16 10:59  Micro-blogSystem\miroblog\Backup\HTMLUI\images\broadcast.png

     文件      35844  2009-12-11 09:24  Micro-blogSystem\miroblog\Backup\HTMLUI\images\default_face.png

     文件       3174  2010-07-16 11:00  Micro-blogSystem\miroblog\Backup\HTMLUI\images\fav.png

     文件      15465  2010-07-14 11:17  Micro-blogSystem\miroblog\Backup\HTMLUI\images\headbg.jpg

     文件       3211  2010-07-16 10:57  Micro-blogSystem\miroblog\Backup\HTMLUI\images\home.png

     文件       1553  2010-07-15 21:15  Micro-blogSystem\miroblog\Backup\HTMLUI\images\loading.gif

     文件       9141  2010-07-15 09:29  Micro-blogSystem\miroblog\Backup\HTMLUI\images\loginBg_l.png

     文件       7372  2010-07-15 09:29  Micro-blogSystem\miroblog\Backup\HTMLUI\images\login_bg.png

     文件       5908  2010-07-15 13:55  Micro-blogSystem\miroblog\Backup\HTMLUI\images\logo.png

     文件       4049  2010-07-15 16:04  Micro-blogSystem\miroblog\Backup\HTMLUI\images\search.png

............此处省略403个文件信息

评论

共有 条评论