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

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

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

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

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

//重载构造函数,传入窗口1的用户名

public Form5(string str) {

InitializeComponent(); user = str;

//设置回车的默认按钮

this.AcceptButton = button_commit; }

private void button_commit_Click(object sender, EventArgs e) {

string connstr = \; //搜索已有的管理员信息

string selectstr = \;

OracleConnection orclConn = new OracleConnection(connstr); OracleCommand selectcomd = orclConn.CreateCommand(); OracleCommand insertcomd=orclConn.CreateCommand(); selectcomd.CommandText = selectstr; selectcomd.Connection = orclConn; orclConn.Open();

OracleDataReader ord = selectcomd.ExecuteReader(); string[] ans = new string[100]; int i = 0; bool ok=true;

//将管理员的用户名存到ans字符串数组中 while (ord.Read()) {

ans[i++] = ord[0].ToString(); }

//密码为空时不创建新用户

if(textBox_password.Text==\) ok=false; //若用户名已存在则不创建 for(int k=0;k

if(textBox_user.Text.Equals(ans[k])) {

ok=false; break; } }

//判断是否创建新用户 if (ok)

{

//创建新用户

string insertstr = \ + textBox_user.Text + \ + textBox_password.Text + \;

insertcomd.CommandText = insertstr; insertcomd.Connection = orclConn; insertcomd.ExecuteNonQuery();

MessageBox.Show(\添加新用户成功\, \添加成功\); this.Close(); } else {

//跳出输入有误的提示

MessageBox.Show(\该用户已存在或者未输入密码\, \添加失败\); textBox_user.Clear(); textBox_password.Clear(); } }

private void button_cancel_Click(object sender, EventArgs e) {

this.Close(); }

管理员操作

验证用户名和密码通过后可以添加歌曲或者删除歌曲:

若信息不完整,则不能添加歌曲:

歌曲ID已存在,同样添加失败:

否则添加成功:

  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

主要代码如下(注释说明了各部分代码的作用): //重载构造函数,传入窗口1的用户名 public Form5(string str) { InitializeComponent(); user = str; //设置回车的默认按钮 this.AcceptButton = button_commit; } private void button_commit_Click(object sender, EventArgs e) { string connstr = \;

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价: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