users.cs
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Data.OleDb;
using Microsoft.Office.Interop.Excel;
using System.Reflection;
using System.IO;
namespace choujiang
{
public class users
{
#region 声明变量
//
private static string strSql;
private string StrExce = null;
private OleDbConnection objCon = null;
//全局变量
DataSet ds = new DataSet();
//
#endregion
#region 构造函数
public users()
{
//连接字符串
StrExce = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Directory.GetCurrentDirectory() + @"/Data/userinfo.mdb";
}
#endregion
#region 按条件获取人员信息 doImport(string str) 参数str: 全员/未中奖/已中奖
public DataSet doImport(string str)
{
this.objCon = new OleDbConnection(this.StrExce);
this.objCon.Open();
if (str == "全员")
{
strSql = "SELECT (select count(*) from userinfo where 序号<=a.序号 ) as xu,a.* FROM userinfo as a where a.工号 is not null ";
strSql = strSql + " order by a.[序号]";
}
else if (str == "未中奖")
{
strSql = "SELECT (select count(*) from userinfo where 序号<=a.序号 and 状态= 0 ) as xu,a.* FROM userinfo as a where a.工号 is not null ";
strSql = strSql + " and a.状态= 0 order by a.[序号] ";
}
else if (str == "已中奖")
{
strSql = "SELECT (select count(*) from userinfo where 序号<=a.序号 and 状态 <>0) as xu,a.* FROM userinfo as a where a.工号 is not null ";
strSql = strSql + " and a.状态 <>0 order by a.[序号]";
}
// MessageBox.Show(str);
OleDbDataAdapter ExcelDA = new OleDbDataAdapter(strSql, objCon);
DataSet ExcelDs = new DataSet();
try
{
ExcelDA.Fill(ExcelDs, "userinfo");
}
catch (Exception err)
后面还有 167 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。