易截截图软件、单文件、免安装、纯绿色、仅160KB

VS2005中,access对只读目录的属性判断不准确

只读目录,
C:\>attrib +A +S +H +R testdir
C:\>attrib testdir
A  SHR     C:\testdir
(1)VC6.0的执行结果:
***********test stat***********************
file [c:\testdir] exists!
file [c:\testdir] is directory!
file [c:\testdir] can be read!
file [c:\testdir] can not be writed!
***********test access***********************
file [c:\testdir] exists!
file [c:\testdir] can not be writed!
file [c:\testdir] can be read!
(2)VS2005的执行结果
***********test stat***********************
file [c:\testdir] exists!
file [c:\testdir] is directory!
file [c:\testdir] can be read!
file [c:\testdir] can not be writed!
***********test access***********************
file [c:\testdir] exists!
file [c:\testdir] can be writed!
file [c:\testdir] can be read!
结论:在VS2005中,使用access判断的只读目录却有【写入】的属性。
         有什么高招,欢迎解答。
建议,在VS2005中对文件、目录进行权限校验时,最好不要用access。
#include <stdio.h>
#include <windows.h>
#include <stdio.h>
#include <io.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
int main(int argc ,char *argv[])
{
struct stat buf;
int ret = 0;
int i=0;

char *file = "c:\\testdir";

printf("***********test stat***********************\n");
ret = stat(file, &buf );
if(ret != 0)
{
printf("stat [%s] fail, errno=%d\n", file, errno);
return -1;
}
else
printf("file [%s] exists!\n", file);

if((buf.st_mode&S_IFDIR)==0)
printf("file [%s] is not directory!\n", file);
else
printf("file [%s] is directory!\n", file);

if((buf.st_mode&S_IREAD)!=0)
printf("file [%s] can be read!\n", file);
else
printf("file [%s] can not be read!\n", file);

if((buf.st_mode&S_IWRITE)!=0)
printf("file [%s] can be writed!\n", file);
else
printf("file [%s


相关文档:

winform导入excel到access数据库中

        项目中用到了此功能。把大概做法跟大家共享下,希望对大家有所帮助。也给自己总结一下,激励自己再接再厉。下面中部分代码被汉字替换了,主要考虑到公司的产品权,希望谅解。
        /// <summary>
      ......

利用 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
    {
   ......

关于ACCESS下OleDbParameter的使用

今天,还是在做那个项目,依然使用往常的sqlhelper用法,往常的数据库操作类,但是偏偏调试不成功,而且最重要的是,它不报错
中午吃饭回来,本来想打算睡个午觉的,但是项目太紧迫了,于是又跟车车研究了一中午,最后,发现如果不用@参数传递的话,是正常运行的,于是百度了一下,那些人说要用“?”当占位符
......

VC++的ADO连接Access步骤

1:在StaAfx.h 中添加如下代码 #import "C:\\Program Files\\Common Files \\System\\ado\\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
2:在BOOL CXXXApp::InitInstance()中初始化COM环境
   ::CoInitialize(NULL);
   释放COM环境
   ::CoUninitialize(); ......

access数据库规格问题


Access 规格
Microsoft Access 数据库规格
Access 数据库
属性最大值
Microsoft Access 数据库 (.mdb) 文件大小
2G 字节减去系统对象所需的空间。
数据库中的对象个数
32,768
模块(包括“内含模块”属性为“是”的窗体和报表)
1,000
对象名称中的字符数
64
密码的字符个数
14
用户名 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号