{
return strTitle; } set {
strTitle = value; } }
public string StrRemind {
get {
return strRemind; } set {
strRemind = value; } }
public string StrImportant {
get {
return strImportant; } set {
strImportant = value; } }
public string StrRemark {
get {
return strRemark; } set {
strRemark = value; } } } }
3.2 添加代码:
using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq;
6
using System.Text;
using System.Windows.Forms;
namespace smartSchedule {
public partial class Add : Form {
public Add() {
InitializeComponent();
cbox_Important.SelectedItem = cbox_Important.Items[0]; cbox_Remind.SelectedItem = cbox_Remind.Items[0]; }
private void btn_Add_Click(object sender, EventArgs e) {
DialogResult dr = MessageBox.Show(\确定添加\, \提示\, MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (dr == DialogResult.Yes) {
Schedule1 sch = new Schedule1(); sch.StrTitle = txt_Title.Text;
sch.IntHour = int.Parse(txt_Hour.Text);
sch.IntDay = int.Parse(dateTimePicker.Value.Day.ToString()); sch.IntYear =
int.Parse(dateTimePicker.Value.Year.ToString()); sch.IntMonth =
int.Parse(dateTimePicker.Value.Month.ToString());
sch.IntMinute = int.Parse(txt_Minute.Text); sch.LongPhone = long.Parse(txt_Phone.Text); sch.StrPlace = txt_Place.Text;
sch.StrImportant = cbox_Important.Text; sch.StrRemark = txt_Remark.Text; sch.StrRemind = cbox_Remind.Text; Schedule.AL_Schedule1.Add(sch); txt_Title.Text = \; txt_Hour.Text = \; txt_Minute.Text = \; txt_Place.Text = \; txt_Phone.Text = \;
cbox_Important.Text = \非常重要\; txt_Remark.Text = \;
cbox_Remind.Text = \不提醒\; } }
private void btn_Return_Click(object sender, EventArgs e) {
this.Close(); }
} }
7
3.3 找回密码代码:
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 smartSchedule {
public partial class FindPassword : Form {
public FindPassword() {
InitializeComponent(); }
private void FindPassword_Load(object sender, EventArgs e) {
//cbox_Email.SelectedIndex = 0; //cbox_Problem.SelectedIndex = 0;
cbox_Emailyu2.SelectedItem = cbox_Emailyu2.Items[0]; cbox_Question2.SelectedItem = cbox_Question2.Items[0]; }
private void btn_OK_Click(object sender, EventArgs e) {
int a = 0;
string[] strName = System.IO.File.ReadAllLines(\); string[] strEmail = System.IO.File.ReadAllLines(\); string[] strEmailyu =
System.IO.File.ReadAllLines(\); string[] strPassword =
System.IO.File.ReadAllLines(\); string[] strAnswer =
System.IO.File.ReadAllLines(\); string[] strQuestion =
System.IO.File.ReadAllLines(\);
for (int i = 0; i < strName.Length; i++) {
if ((strName[i] == txt_Name2.Text && strEmail[i] == txt_Email2.Text && strEmailyu[i] == cbox_Emailyu2.Text)
|| (strName[i] == txt_Name2.Text && strAnswer[i] == txt_Answer2.Text && strQuestion[i] == cbox_Question2.Text)) {
MessageBox.Show(\您的密码是:\ + strPassword[i], \提示\, MessageBoxButtons.OK, MessageBoxIcon.Information); Schedule sch = new Schedule();
8
sch.ShowDialog(); a = 1; break; } }
if (a == 0) {
MessageBox.Show(\找回密码失败!\); } }
private void btn_Return_Click(object sender, EventArgs e) {
this.Close(); } } }
3.4 登录注册代码:
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.Collections;
namespace smartSchedule {
public partial class Huanying : Form {
public Huanying() {
InitializeComponent(); }
private void lbl_Forget_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
Form findPassword = new FindPassword(); findPassword.Show(); }
private void btn_Register_Click(object sender, EventArgs e) {
Form register = new Register(); register.Show(); }
private void btn_OK_Click(object sender, EventArgs e)
9
{
int a = 0;
string [] A_strName =
System.IO.File.ReadAllLines(\); string [] A_strPassword =
System.IO.File.ReadAllLines(\);
for (int i = 0; i < A_strName.Length; i++) {
if (A_strName[i] == txt_Name1.Text && A_strPassword[i] == txt_Password1.Text) {
Schedule sch = new Schedule(); Schedule.h = this; sch.ShowDialog(); a = 1; break; } }
if (a == 0) {
MessageBox.Show(\密码错误!\); txt_Password1.Text = \; } } } }
3.5 提醒代码:
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 smartSchedule {
public partial class Remind : Form {
public Remind() {
InitializeComponent(); }
private void Remind_Load(object sender, EventArgs e) {
int day = int.Parse(dateTimePicker1.Value.Day.ToString()); int month = int.Parse(dateTimePicker1.Value.Month.ToString());
int year = int.Parse(dateTimePicker1.Value.Year.ToString());
10