11-硬件读写/短信猫/NoteCatVote/Form2.cs

(开头部分) 4KB

这里只显示每个文件的开头 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;

namespace NoteCatVote
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (txtItem.Text == "" || txtVote.Text == ""||txtContent.Text=="")
            {
                MessageBox.Show("请输入投票项目或初始票数","警告",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
            else
            {
                if (DataClass.DataNum() < 4)
                {
                    int isf;
                    if (cbbIs.SelectedIndex == 0)
                    {
                        isf = 1;
                    }
                    else
                    {
                        isf = 0;
                    }
                    string str = "insert into tb_Vote(Item,Ballot,content,IsRelease) values('" + txtItem.Text.Trim() + "','" + Convert.ToInt32(txtVote.Text.Trim()) + "','" + txtContent.Text.Trim() + "','" + isf + "')";
                    if (DataClass.ExecuteSQL(str) > 0)
                    {
                        MessageBox.Show("输入成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        txtItem.Text = "";
                        txtVote.Text = "";
                    }
                }
                else
                {
                    MessageBox.Show("只允许添加四个投票选项!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void txtVote_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!(e.KeyChar <= '9' && e.KeyChar >= '0') && e.KeyChar != '\r' && e.KeyChar != '\b')
后面还有 75 行代码,解锁后查看完整代码

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

AI 解读

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

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