抽奖软件,成品
C# 开发的抽奖软件,带数据库,已经使用中,反响比较积极
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 352906 2014-01-01 15:14 CCFSindatachoujiang.wav
文件 1764112 2014-01-01 21:14 CCFSindatagongxi.wav
文件 1764112 2014-01-01 21:14 CCFSindatajoin.wav
文件 28887664 2013-12-31 17:33 CCFSindatayinyue.wav
文件 7913 2019-01-18 11:39 CCFSCCFS.csproj
文件 609 2013-12-30 20:42 CCFSCCFS.csproj.user
文件 1676 2019-01-08 19:07 CCFSCCFS_TemporaryKey.pfx
文件 5229 2019-01-09 09:52 CCFSDataAccess.cs
文件 25140 2019-01-25 13:23 CCFSFS_Main.cs
文件 24822 2019-01-25 13:23 CCFSFS_Main.Designer.cs
文件 13715 2019-01-25 13:23 CCFSFS_Main.resx
文件 294369 2010-01-25 17:59 CCFSimgBJ003.jpg
文件 3397 2019-01-08 15:29 CCFSimgenter1.png
文件 2525 2004-12-08 11:15 CCFSimgkai.png
文件 20339 2019-01-09 11:50 CCFSimgkai1.jpg
文件 7788 2019-01-09 11:59 CCFSimgkai2.jpg
文件 1396 2019-01-08 15:49 CCFSimgkaishi1.png
文件 4286 2019-01-08 17:17 CCFSimglogo.ico
文件 399654 2019-01-08 16:20 CCFSimglogo.png
文件 3341 2019-01-08 15:29 CCFSimgspace1.png
文件 1164 2019-01-08 15:54 CCFSimg ingzhi.png
文件 10901 2019-01-08 19:36 CCFSLD_DataManage.cs
文件 12065 2019-01-08 19:12 CCFSLD_DataManage.Designer.cs
文件 44309 2019-01-08 18:32 CCFSLD_DataManage.resx
文件 7299 2019-01-08 19:10 CCFSLD_Setting.cs
文件 13225 2019-01-08 19:09 CCFSLD_Setting.Designer.cs
文件 43940 2019-01-08 18:32 CCFSLD_Setting.resx
文件 4286 2019-01-08 17:17 CCFSlogo.ico
文件 78848 2007-02-17 06:43 CCFSmsiexec.exe
文件 1496 2019-01-29 12:49 CCFSobjDebugCCFS.csproj.FileListAbsolute.txt
............此处省略34个文件信息
using System;
using System.Data;
using System.Configuration;
using System.Data.OleDb;
using System.Text;
using System.Windows.Forms;
///
/// DataAccess 为数据库操作等全局定义的一些类
///
public class DataAccess
{
public DataAccess()
{
}
public static bool DataIsChange;
#region 配置数据库连接字符串
///
/// 获取C/S系统根目录
///
public static string SysRootPath()
{
string resultPath = string.Empty;
string sysPath = Application.StartupPath;
if (sysPath.LastIndexOf(“bin“) > 0)
{
resultPath = sysPath.Substring(0 sysPath.LastIndexOf(“bin“));
}
else
{
resultPath = sysPath;
}
return resultPath;
}
///
/// 配置数据库连接字符串
///
private static string ConnectionString = “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=“ + System.Environment.CurrentDirectory + “\data\LD.mdb;Persist Security Info=False;Jet OLEDB:Database Password=xuandawei;“;
#endregion
#region 执行SQL语句,返回Bool值
///
/// 执行SQL语句,返回Bool值
///
/// 要执行的SQL语句
/// 返回BOOL值,True为执行成功
public bool ExecuteSQL(string sql)
{
OleDbConnection con = new OleDbConnection(ConnectionString);
OleDbCommand cmd = new OleDbCommand(sql con);
try
{
con.Open();
cmd.ExecuteNonQuery();
return true;
}
catch
{
return false;
}
finally
{
con.Close();
con.Dispose();
cmd.Dispose();
}
}
#endregion
#region 读取带参数的结果集
///
/// 读取带参数的结果集
///
/// SQL语句
/// 参数列表
/// 结果集
public OleDbDataReader ExecuteReader(string sql)
{
OleDbDataReader reader = null;
OleDbConnection con = new OleDbConnection(ConnectionString);
OleDbCommand cmd = new OleDbCommand(sql con);
try
{
con.Open();
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
}
catch
{
}
return reader;
}
#endregion
#region 执行SQL语句,返回DataTable
///
/// 执行SQL语句,返回DataTable
///
/// 要执行的SQL语句
/// 返回DataTable类型的执行结果
public DataTable GetDataTable(string sql)
{
DataSet ds = new DataSet();
OleDbConnection con = new OleDbConnection(ConnectionString);
OleDbDataAdapter da = new OleDbDataAdapter(sql con);
try
{
da.Fill(ds “tb“);
}
catch (Exception ex)
{
throw new Exception
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 352906 2014-01-01 15:14 CCFSindatachoujiang.wav
文件 1764112 2014-01-01 21:14 CCFSindatagongxi.wav
文件 1764112 2014-01-01 21:14 CCFSindatajoin.wav
文件 28887664 2013-12-31 17:33 CCFSindatayinyue.wav
文件 7913 2019-01-18 11:39 CCFSCCFS.csproj
文件 609 2013-12-30 20:42 CCFSCCFS.csproj.user
文件 1676 2019-01-08 19:07 CCFSCCFS_TemporaryKey.pfx
文件 5229 2019-01-09 09:52 CCFSDataAccess.cs
文件 25140 2019-01-25 13:23 CCFSFS_Main.cs
文件 24822 2019-01-25 13:23 CCFSFS_Main.Designer.cs
文件 13715 2019-01-25 13:23 CCFSFS_Main.resx
文件 294369 2010-01-25 17:59 CCFSimgBJ003.jpg
文件 3397 2019-01-08 15:29 CCFSimgenter1.png
文件 2525 2004-12-08 11:15 CCFSimgkai.png
文件 20339 2019-01-09 11:50 CCFSimgkai1.jpg
文件 7788 2019-01-09 11:59 CCFSimgkai2.jpg
文件 1396 2019-01-08 15:49 CCFSimgkaishi1.png
文件 4286 2019-01-08 17:17 CCFSimglogo.ico
文件 399654 2019-01-08 16:20 CCFSimglogo.png
文件 3341 2019-01-08 15:29 CCFSimgspace1.png
文件 1164 2019-01-08 15:54 CCFSimg ingzhi.png
文件 10901 2019-01-08 19:36 CCFSLD_DataManage.cs
文件 12065 2019-01-08 19:12 CCFSLD_DataManage.Designer.cs
文件 44309 2019-01-08 18:32 CCFSLD_DataManage.resx
文件 7299 2019-01-08 19:10 CCFSLD_Setting.cs
文件 13225 2019-01-08 19:09 CCFSLD_Setting.Designer.cs
文件 43940 2019-01-08 18:32 CCFSLD_Setting.resx
文件 4286 2019-01-08 17:17 CCFSlogo.ico
文件 78848 2007-02-17 06:43 CCFSmsiexec.exe
文件 1496 2019-01-29 12:49 CCFSobjDebugCCFS.csproj.FileListAbsolute.txt
............此处省略34个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)