云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > Oracle课程设计报告(简易点歌台系统)

Oracle课程设计报告(简易点歌台系统)

  • 62 次阅读
  • 3 次下载
  • 2025/5/6 13:13:28

该部分的主要代码如下(其中注释说明各部分代码的作用):

//删除已点歌曲

private void button_delete_Click(object sender, EventArgs e) {

if (listBox_Playingmusic.SelectedIndex == -1) return;

int num = listBox_Playingmusic.SelectedIndex; //删除播放列表信息

for (int i = num; i < cnt-1; i++) for (int j = 0; j < 6; j++)

singing[i, j] = singing[i + 1, j];

listBox_Playingmusic.Items.Remove(listBox_Playingmusic.SelectedItem); //更新状态栏

if (listBox_Playingmusic.Items.Count > 0) stastr = \正在播放:\ + singing[0, 1]; else {

toolStripStatusLabel1.Text = \; goto mark; }

if (listBox_Playingmusic.Items.Count > 1) stastr += \,下一曲:\ + singing[1, 1]; toolStripStatusLabel1.Text = stastr; mark: statusStrip1.Show();

//如果删除的歌曲是当前正在播放的歌曲,则更新倒计时 if (num == 0) {

if(listBox_Playingmusic.Items.Count == 0) for (int j = 0; j < 6; j++) singing[0, j] =\;

if (listBox_Playingmusic.Items.Count > 0) second = int.Parse(singing[0, 4]); else {

second = 0;

toolStripStatusLabel2.Text = \; } } cnt--;

textBox_count.Text = listBox_Playingmusic.Items.Count.ToString(); }

查看历史记录

点击右下方蓝色小字“查看点歌历史记录”可查看历史点歌记录,包括歌曲ID、歌曲名、点歌时间,按确定可关闭窗口,结果如图:

该部分的主要代码如下:

//查看历史播放记录

private void label9_Click(object sender, EventArgs e) {

Form3 form3=new Form3(); form3.Show(); }

//显示历史播放记录

private void Form3_Load(object sender, EventArgs e) {

string connStr; string queryString;

connStr = \;

queryString = \; OracleConnection conn = new OracleConnection(connStr); OracleCommand orclComd = conn.CreateCommand(); orclComd.CommandText = queryString; conn.Open();

OracleDataAdapter oraDA = new OracleDataAdapter(orclComd); DataSet ds = new DataSet(); oraDA.Fill(ds); conn.Close();

DataTable dtbl = ds.Tables[0]; this.dataGridView1.DataSource = dtbl; conn.Close(); }

//按确定键关闭窗口

private void button1_Click(object sender, EventArgs e) {

this.Close(); }

其余部分

另外还有一些重要的零散代码,如对文本框进行编辑时设置回车键的默认按钮、设置Timer事件等代码如下:

//以下三个函数分别改变按回车键时默认的Button

private void listBox_Selectedmusic_SelectedIndexChanged(object sender, EventArgs e) {

this.AcceptButton = button_play; }

private void listBox_Playingmusic_SelectedIndexChanged(object sender, EventArgs e) {

this.AcceptButton = button_delete; }

private void textBox_song_TextChanged(object sender, EventArgs e) {

this.AcceptButton = button_select; }

//设置每秒发生的事件

private void timer1_Tick(object sender, EventArgs e) {

if (second > 0) {

toolStripStatusLabel2.Text = \剩余时间:\; if (second / 60 > 0)

toolStripStatusLabel2.Text += ((second / 60).ToString() + \分\); if (second % 60 > 0)

toolStripStatusLabel2.Text += ((second % 60).ToString() + \秒\); }

if(listBox_Playingmusic.Items.Count>0) //如果播放列表不为空 if (second == 0) //如果当前播放歌曲结束 {

listBox_Playingmusic.Items.RemoveAt(0); for (int i = 0; i < cnt - 1; i++) for (int j = 0; j < 6; j++)

singing[i, j] = singing[i + 1, j]; //更新状态栏

if (listBox_Playingmusic.Items.Count > 0) {

stastr = \正在播放:\ + singing[0, 1]; second = int.Parse(singing[0, 4]); cnt--; } else {

toolStripStatusLabel1.Text = \; goto mark; }

if (listBox_Playingmusic.Items.Count > 1) stastr += \,下一曲:\ + singing[1, 1]; toolStripStatusLabel1.Text = stastr; mark: statusStrip1.Show();

textBox_count.Text = listBox_Playingmusic.Items.Count.ToString(); toolStripStatusLabel2.Text = \; }

if (second > 0) second--; }

搜索更多关于: Oracle课程设计报告(简易点歌台系统) 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

该部分的主要代码如下(其中注释说明各部分代码的作用): //删除已点歌曲 private void button_delete_Click(object sender, EventArgs e) { if (listBox_Playingmusic.SelectedIndex == -1) return; int num = listBox_Playingmusic.SelectedIndex; //删除播放列表信息 for (int i = num; i < cnt-1; i++) for (int j = 0; j

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com