gradestu.cs
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace LoginFrame
{
public partial class gradestu : Form
{
public gradestu()
{
InitializeComponent();
// 1-7 选出最大分数
string sql1 = string.Format("select max(总分) from stuinfo;");
string sql2 = string.Format("select max(数学) from stuinfo;");
string sql3 = string.Format("select max(语文) from stuinfo;");
string sql4 = string.Format("select max(英语) from stuinfo;");
string sql5 = string.Format("select max(物理) from stuinfo;");
string sql6 = string.Format("select max(化学) from stuinfo;");
string sql7 = string.Format("select max(生物) from stuinfo;");
// 8-14 选出自己的成绩以登录的loginid查询
string sql8 = string.Format("select 总分 from stuinfo where loginid='{0}';",global.myusername);
string sql9 = string.Format("select 数学 from stuinfo where loginid='{0}';", global.myusername);
string sql10= string.Format("select 语文 from stuinfo where loginid='{0}';", global.myusername);
string sql11= string.Format("select 英语 from stuinfo where loginid='{0}';", global.myusername);
string sql12= string.Format("select 物理 from stuinfo where loginid='{0}';", global.myusername);
string sql13= string.Format("select 化学 from stuinfo where loginid='{0}';", global.myusername);
string sql14= string.Format("select 生物 from stuinfo where loginid='{0}';", global.myusername);
// 查询出登录id 对应的 名字
string sql15 = string.Format("select name from stuinfo where loginid='{0}';", global.myusername);
// 查询出 总分的排名
string sql16 = string.Format("select rank() over ( order by 总分 desc) graderank,* from stuinfo where loginid='{0}';", global.myusername);
SqlCommand command1 = new SqlCommand(sql1, DbHelper.connection);
SqlCommand command2 = new SqlCommand(sql2, DbHelper.connection);
SqlCommand command3 = new SqlCommand(sql3, DbHelper.connection);
SqlCommand command4 = new SqlCommand(sql4, DbHelper.connection);
SqlCommand command5 = new SqlCommand(sql5, DbHelper.connection);
SqlCommand command6 = new SqlCommand(sql6, DbHelper.connection);
SqlCommand command7 = new SqlCommand(sql7, DbHelper.connection);
SqlCommand command8 = new SqlCommand(sql8, DbHelper.connection);
SqlCommand command9 = new SqlCommand(sql9, DbHelper.connection);
SqlCommand command10= new SqlCommand(sql10, DbHelper.connection);
SqlCommand command11= new SqlCommand(sql11, DbHelper.connection);
SqlCommand command12= new SqlCommand(sql12, DbHelper.connection);
SqlCommand command13= new SqlCommand(sql13, DbHelper.connection);
SqlCommand command14= new SqlCommand(sql14, DbHelper.connection);
SqlCommand command15 = new SqlCommand(sql15, DbHelper.connection);
SqlCommand command16 = new SqlCommand(sql16, DbHelper.connection);
DbHelper.connection.Open();
string all1 = Convert.ToString(command1.ExecuteScalar());
string all2 = Convert.ToString(command2.ExecuteScalar());
string all3 = Convert.ToString(command3.ExecuteScalar());
string all4 = Convert.ToString(command4.ExecuteScalar());
string all5 = Convert.ToString(command5.ExecuteScalar());
后面还有 67 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
