• 大小: 404KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-14
  • 语言: C#
  • 标签: c#  课设  备忘录  

资源简介

大学项目设计C#备忘录程序设计+完整项目源代码,软件具备登录,注册,添加 ,删除,提醒等功能,挂sql数据库,欢迎交流学习。

资源截图

代码片段和文件信息

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 System.Data.SqlClient;

namespace memorandum
{
    public partial class frmEdit : Form
    {
        public frmEdit()
        {
            InitializeComponent();
        }

        //关闭编辑窗口
        private void button2_Click(object sender EventArgs e)
        {
            this.Close();
        }




        string name = frmLogin.userName;
        //保存备忘
        private void button1_Click(object sender EventArgs e)
        {
            if (txttitle.Text.Trim().Length == 0)
            {
                MessageBox.Show(“标题不能为空“);
            }
            else if (rabtnNoRemind.Checked == false && rabtnRemind.Checked == false)
            {
                MessageBox.Show(“请设置是否提醒。“);
            }
            else
            {
                string rabtn = null;
                if (rabtnNoRemind.Checked == true)
                {
                    rabtn = “不提醒“;
                }
                else if (rabtnRemind.Checked == true)
                {
                    rabtn = “提醒“;
                }

                long longNowTime = long.Parse(DateTime.Now.ToString(“yyyyMMddHHmmss“));
                string dt = dateTimePicker1.Value.ToString(“yyyy/MM/dd“) + “ “ + dateTimePicker2.Value.ToString(“HH:mm:ss“);
                long longSaveTime = long.Parse(dt.Substring(0 4) + dt.Substring(5 2) + dt.Substring(8 2) +
                    dt.Substring(11 2) + dt.Substring(14 2) + dt.Substring(17 2));
                if (longSaveTime > longNowTime)//判断选择是时间是否大于当前时间
                {
                    string connstring = @“Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Administrator.USER-20160103AR\Desktop\memorandum\memorandum\shuju_memoarndum.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True“;
                    SqlConnection conn = new SqlConnection(connstring);
                    conn.Open();
                    string sql = “insert into tab_Record(titletimetypeeventremindUserName) values (‘“ + txttitle.Text + “‘‘“ + dt + “‘‘“ + cbxType.Text + “‘‘“ + txtEvent.Text + “‘‘“ + rabtn + “‘‘“ + name + “‘)“;
                    SqlCommand cmd = new SqlCommand(sql conn);
                    int i = cmd.ExecuteNonQuery();
                    if (i == 1)
                    {
                        MessageBox.Show(“添加成功“);
                    }
                    else
                    {
                        MessageBox.Show(“添加失败“);
                    }//else
                    //if (MessageBox.Show(“成功保存!\r\n点击“是”退出,点击“否”继续添加...“ “提醒“
                    //MessageBoxButtons.YesNo MessageBoxIcon.Asterisk) == DialogResult.Yes)
                    //{
                    //    this.Close();
                    //}
                }
   

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

     文件        872  2016-01-04 08:08  memorandum\memorandum.sln

    ..A..H.     32256  2016-01-06 19:50  memorandum\memorandum.suo

     文件        192  2016-01-05 09:39  memorandum\tab_Record.txt

     文件      64854  2009-06-11 04:40  memorandum\Windows Logoff Sound.wav

     文件        464  2016-01-04 08:29  memorandum\memorandum\app.config

     文件       3391  2016-01-06 19:42  memorandum\memorandum\frmEdit.cs

     文件      10113  2016-01-06 19:42  memorandum\memorandum\frmEdit.Designer.cs

     文件       5817  2016-01-06 19:42  memorandum\memorandum\frmEdit.resx

     文件       2390  2016-01-06 19:41  memorandum\memorandum\frmLogin.cs

     文件       9401  2016-01-06 19:41  memorandum\memorandum\frmLogin.Designer.cs

     文件       5817  2016-01-06 19:41  memorandum\memorandum\frmLogin.resx

     文件       5184  2016-01-06 19:20  memorandum\memorandum\frmLook.cs

     文件       9134  2016-01-06 19:28  memorandum\memorandum\frmLook.Designer.cs

     文件       6826  2016-01-06 19:20  memorandum\memorandum\frmLook.resx

     文件       2570  2016-01-06 19:20  memorandum\memorandum\frmMain.cs

     文件       5629  2016-01-06 19:28  memorandum\memorandum\frmMain.Designer.cs

     文件       6011  2016-01-06 19:20  memorandum\memorandum\frmMain.resx

     文件       1826  2016-01-05 18:29  memorandum\memorandum\frmRegister.cs

     文件       5758  2016-01-05 18:26  memorandum\memorandum\frmRegister.Designer.cs

     文件       5817  2016-01-05 18:26  memorandum\memorandum\frmRegister.resx

     文件       2024  2016-01-06 19:27  memorandum\memorandum\frmRemind.cs

     文件       3289  2016-01-06 15:47  memorandum\memorandum\frmRemind.Designer.cs

     文件       5817  2016-01-06 15:47  memorandum\memorandum\frmRemind.resx

     文件       1668  2016-01-04 16:20  memorandum\memorandum\frmRePwd.cs

     文件       5929  2016-01-04 16:20  memorandum\memorandum\frmRePwd.Designer.cs

     文件       5817  2016-01-04 16:20  memorandum\memorandum\frmRePwd.resx

     文件       8750  2016-01-06 12:43  memorandum\memorandum\memorandum.csproj

     文件        452  2016-01-04 08:35  memorandum\memorandum\memorandum.csproj.user

     文件        494  2016-01-06 08:56  memorandum\memorandum\Program.cs

     文件    2359296  2016-01-06 19:37  memorandum\memorandum\shuju_memoarndum.mdf

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

评论

共有 条评论