LoginHome.cs

(开头部分) 15KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using MySql.Data.MySqlClient;
using System.IO;

namespace BBS
{
    public partial class LoginHome : Form
    {
        // 设置右上角关闭按钮不可用
        protected override void WndProc(ref   Message m)
        {
            const int WM_SYSCOMMAND = 0x0112;
            const int SC_CLOSE = 0xF060;
            if (m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE)
            {
                return;
            }
            base.WndProc(ref m);
        }

        public Byte[] mybyte = new byte[0];

        public LoginHome()
        {
            InitializeComponent();
        }

        static bool Find(int[] array, int a, int n)
        {
            for (int i = 0; i < n; i++)
            {
                if (array[i] == a)
                {
                    return true;
                }
            }
            return false;
        }

        // 文章随机展示函数
        private void randon_show_articles()
        {
            // 链接数据库获取文章数据
            string sqlconf = "Server=127.0.0.1;User ID=root;Password=51aspx;Database=bbs_csharp;";
            MySqlConnection sqlConnection = new MySqlConnection(sqlconf);
            sqlConnection.Open();
            string sql1 = "SELECT article.id,title,abstract,article.create_time,up_num,down_num,`name`,avatar FROM article RIGHT JOIN user ON article.user_id = user.id WHERE article.id IS NOT NULL;";
            MySqlCommand sqlCommand1 = new MySqlCommand(sql1, sqlConnection);
            MySqlDataAdapter mysqlDataAdapter = new MySqlDataAdapter(sqlCommand1);
            DataSet dataset = new DataSet();
            mysqlDataAdapter.Fill(dataset, "Article");
            int total = dataset.Tables["Article"].Rows.Count; // 总的数据行数
后面还有 325 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。