[校园一卡通]——项目开发计划
for (int i = 0; i < this.MdiChildren.Length; i++) {
Form tempChild = (Form)this.MdiChildren[i]; tempChild.Close(); }
teacherquayer.MdiParent = this;
teacherquayer.WindowState = FormWindowState.Maximized; teacherquayer.Show(); }
private void MenuItem16_Click(object sender, EventArgs e) {
this.Close(); }
private void MenuItem21_Click(object sender, EventArgs e) {
Form teacherchengjiu = new Teacherchengjiu (); for (int i = 0; i < this.MdiChildren.Length; i++) {
Form tempChild = (Form)this.MdiChildren[i]; tempChild.Close(); }
teacherchengjiu.MdiParent = this;
teacherchengjiu.WindowState = FormWindowState.Maximized; teacherchengjiu.Show(); }
private void MenuItem22_Click(object sender, EventArgs e) {
Form message= new Messgae ();
for (int i = 0; i < this.MdiChildren.Length; i++) {
Form tempChild = (Form)this.MdiChildren[i]; tempChild.Close(); }
message.MdiParent = this;
message.WindowState = FormWindowState.Maximized; message.Show(); }
private void MenuItem31_Click(object sender, EventArgs e) {
Form teachrongyu = new Teacherrongyu ();
15
[校园一卡通]——项目开发计划
for (int i = 0; i < this.MdiChildren.Length; i++) {
Form tempChild = (Form)this.MdiChildren[i]; tempChild.Close(); }
teachrongyu.MdiParent = this;
teachrongyu.WindowState = FormWindowState.Maximized; teachrongyu.Show(); }
private void MenuItem32_Click(object sender, EventArgs e) {
Form message = new Messgae ();
for (int i = 0; i < this.MdiChildren.Length; i++) {
Form tempChild = (Form)this.MdiChildren[i]; tempChild.Close(); }
message.MdiParent = this;
message.WindowState = FormWindowState.Maximized; message.Show(); }
private void MenuItem41_Click(object sender, EventArgs e) {
Form teacherlunwen = new Teacherlunwen (); for (int i = 0; i < this.MdiChildren.Length; i++) {
Form tempChild = (Form)this.MdiChildren[i]; tempChild.Close(); }
teacherlunwen.MdiParent = this;
teacherlunwen.WindowState = FormWindowState.Maximized; teacherlunwen.Show(); }
private void MenuItem42_Click(object sender, EventArgs e) {
Form studentvister= new StudentVister ();
for (int i = 0; i < this.MdiChildren.Length; i++) {
Form tempChild = (Form)this.MdiChildren[i]; tempChild.Close(); }
16
[校园一卡通]——项目开发计划
studentvister.MdiParent = this;
studentvister.WindowState = FormWindowState.Maximized; studentvister.Show(); }
private void MenuItem43_Click(object sender, EventArgs e) {
Form teachervister = new TeacherVister (); for (int i = 0; i < this.MdiChildren.Length; i++) {
Form tempChild = (Form)this.MdiChildren[i]; tempChild.Close(); }
teachervister.MdiParent = this;
teachervister.WindowState = FormWindowState.Maximized; teachervister.Show(); }
private void MenuItem50_Click(object sender, EventArgs e) {
FrmMain frm = new FrmMain(); frm.Show(); this.Hide(); } } }
17
[校园一卡通]——项目开发计划 18
using System;
using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text;
using System.Windows.Forms; using System.IO;
namespace 校园一卡通 {
public partial class FrmSong : Form {
//申明一个字符串数组来储存歌曲的地址
private string[] urlname = new string[2000]; WMPLib.IWMPMediaCollection mediacollection; WMPLib.IWMPMedia media; public FrmSong() {
InitializeComponent(); }
private void FrmSong_Load(object sender, EventArgs e)
[校园一卡通]——项目开发计划 {
}
private void MenuItem11_Click(object sender, EventArgs e) {
try {
DialogResult result = openFileDialog1.ShowDialog(); if (result == DialogResult.OK) {
//songname为歌曲名 string songname =
openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf(\) + 1); songname = songname.Substring(0, songname.Length - 1);
19
//刷新当前播放的列表
axWindowsMediaPlayer1.currentPlaylist.clear();
//同步刷新listBox
listBox1.Items.Clear();
axWindowsMediaPlayer1.URL = openFileDialog1.FileName; this .Text =songname+\; listBox1.Items.Add(songname);
urlname[listBox1.Items.Count - 1] = openFileDialog1.FileName;
//播放当前打开的曲目
axWindowsMediaPlayer1.Ctlcontrols.play();
}
}
catch (Exception error) {
MessageBox.Show(error.Message.ToString()); } }
private void MenuItem12_Click(object sender, EventArgs e) {
listBox1.Items.Clear();
this.axWindowsMediaPlayer1.Ctlcontrols.stop(); }
private void MenuItem13_Click(object sender, EventArgs e)