资源简介
图片的存储、管理、查询、求解两张图片的相似度(基于颜色特征矩阵)
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;
using System.IO;
namespace MSSP
{
public class DB
{
public static string ConnectString;
public static string ServerIp;
private SqlConnection sqlCon = new SqlConnection();
private SqlDataAdapter sqlAdapter = new SqlDataAdapter();
public DB()
{
ConnectString = “data source = GAOWEI-PC\\QIU;initial catalog = MSSP;user id = sa;password = ‘sa123456‘“;
//远程
//ConnectString = “data source = PC-201004242309\\MSSP;initial catalog = MSSP;user id = sa;password = ‘sa123456‘“;
//笔记本
//ConnectString = “data source = PC-200911132328\\NKU;initial catalog = MSSP;user id = sa;password = ‘sa123456‘“;
}
///
/// 打开连接
///
///
public bool Open()
{
if (ConnectString == null || ConnectString == ““)
{
return false;
}
try
{
sqlCon.Close();
sqlCon.ConnectionString = ConnectString;
sqlCon.Open();
}
catch
{
return false;
}
return true;
}
///
/// 关闭连接
///
public void Close()
{
sqlCon.Close();
}
///
/// 填充数据集
///
/// 待填充数据集
/// 数据集中Table的名字
/// select 语句
///
public void Fill(DataSet ds string TableName string sqlSelectCmd)
{
if (!this.Open())
{
Exception err = new Exception(“与数据库联接失败!“);
throw err;
}
SqlCommand cmd = sqlCon.CreateCommand();
cmd.CommandText = sqlSelectCmd;
cmd.CommandTimeout = 3600;
this.sqlAdapter.SelectCommand = cmd;
try
{
SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(this.sqlAdapter);
this.sqlAdapter.Fill(ds TableName);
}
catch (Exception err)
{
throw err;
}
this.Close();
}
public void Fill(DataSet ds string TableName string sqlSelectCmdSqlParameter[] paras)
{
if (!this.Open())
{
Exception err = new Exception(“与数据库联接失败!“);
throw err;
}
SqlCommand cmd = sqlCon.CreateCommand();
cmd.CommandText = sqlSelectC
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2013-05-29 11:21 MSSP\
目录 0 2013-05-29 11:21 MSSP\Backup\
目录 0 2013-05-29 11:21 MSSP\Backup\MSSP\
文件 293 2010-04-09 16:18 MSSP\Backup\MSSP\App.config
文件 10865 2010-05-08 10:42 MSSP\Backup\MSSP\DB.cs
文件 48129 2010-05-06 23:43 MSSP\Backup\MSSP\Form1.Designer.cs
文件 36076 2010-05-07 00:20 MSSP\Backup\MSSP\Form1.cs
文件 6185 2010-05-06 23:43 MSSP\Backup\MSSP\Form1.resx
文件 10373 2010-04-25 16:20 MSSP\Backup\MSSP\Form_XGSX.Designer.cs
文件 2081 2010-04-25 16:40 MSSP\Backup\MSSP\Form_XGSX.cs
文件 5814 2010-04-25 16:20 MSSP\Backup\MSSP\Form_XGSX.resx
文件 9390 2010-05-08 10:38 MSSP\Backup\MSSP\HSV.cs
文件 4574 2010-05-06 22:55 MSSP\Backup\MSSP\MSSP.csproj
文件 463 2010-04-09 14:38 MSSP\Backup\MSSP\Program.cs
目录 0 2013-05-29 11:21 MSSP\Backup\MSSP\Properties\
文件 1180 2010-04-09 14:38 MSSP\Backup\MSSP\Properties\AssemblyInfo.cs
文件 2864 2010-04-09 14:38 MSSP\Backup\MSSP\Properties\Resources.Designer.cs
文件 5612 2010-04-09 14:38 MSSP\Backup\MSSP\Properties\Resources.resx
文件 1089 2010-04-09 14:38 MSSP\Backup\MSSP\Properties\Settings.Designer.cs
文件 249 2010-04-09 14:38 MSSP\Backup\MSSP\Properties\Settings.settings
文件 11644 2010-04-27 09:11 MSSP\Backup\MSSP\Restore.Designer.cs
文件 15141 2010-05-08 12:06 MSSP\Backup\MSSP\Restore.cs
文件 6024 2010-04-27 09:11 MSSP\Backup\MSSP\Restore.resx
文件 559 2010-04-26 21:33 MSSP\Backup\MSSP\Similarity.cs
文件 786 2010-04-26 21:30 MSSP\Backup\MSSP\Unit_HSV.cs
文件 802 2010-04-26 21:29 MSSP\Backup\MSSP\Unit_RGB.cs
文件 3405 2010-04-21 17:11 MSSP\Backup\MSSP\picView.Designer.cs
文件 2705 2010-04-27 09:43 MSSP\Backup\MSSP\picView.cs
文件 6021 2010-04-21 17:11 MSSP\Backup\MSSP\picView.resx
文件 1700 2010-05-08 10:24 MSSP\Backup\MSSP\showPic.cs
文件 901 2010-04-09 14:38 MSSP\Backup\MSSP.sln
............此处省略73个文件信息
评论
共有 条评论