利用 DataGridView 绘制图片列表(从Access读取图片)
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Win32;
using Access = Microsoft.Office.Interop.Access;
namespace ImageAccess
{
static class Program
{
#region DllImportAttribute
[DllImport("user32.dll", EntryPoint = "ShowWindow")]
static extern bool ShowWindow(IntPtr handle, int flags);
[DllImport("user32.dll", EntryPoint = "SetForegroundWindow")]
static extern bool SetForegroundWindow(IntPtr handle);
#endregion
[STAThread]
static void Main()
{
#region Mutex
bool isCreated; // 互斥体名称须唯一。
using (Mutex newMutex = new Mutex(true, @"Local\ImageAccess", out isCreated))
{
if (isCreated)
{
string dbPath = Path.Combine(Application.StartupPath, "Images.mdb");
if (File.Exists(dbPath))
&nb
相关文档:
void ModifyDBCode()
{
CString strPath;
::GetModuleFileName(GetModuleHandle(NULL),strPath.GetBuffer(256),256);
strPath.ReleaseBuffer();
int flag=strPath.ReverseFind('\\');
int size=strPath.GetLength();
strPath.Delete(flag,size-flag);
strPath= strPath+ ......
C#中访问关键字(access keyword)有两个:base、this
1.base
用于从派生类中访问基类的成员,包括:
a.调用基类上已被其它方法重写(override)的方法。
b.指定创建派生类实例时应调用的基类构造函数。
注意:对基类的访问只能 ......
最近系统运行中发现Access 2003 版本中对待 Null 和 ‘’ (空字符)奇怪问题,重现步骤:
1、创建表tabTest ;
2、使用设计视图添加两个字段 ID ,col1
名称
类型
长度
说明
ID
Number
主键,自增
Col1
char
1
无
3、使用sql 添加如下数据
-- col1 字段设置为 null
INS ......
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows.Forms;
using Microsoft.Win32;
using Access = Microsoft.Office.Interop.Access;
namespace ImageAccess
{
static class Program
{
......