C/C++ 路径为目录判断
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
/****************************************************
* 函数功能: 判断参数路径是否为(正确的)目录
* 函数返回: 0为表示路径为文件,1为非目录.其他为错误
* 参数: path文件需要判断的目录的路径.
* 可以为相对路径.
*
*****************************************************/
int isDir(const char *path)
{
struct stat info;
if ( 0 != stat(path,&info) )
{
return -2;
}
if( info.st_mode & S_IFDIR )
{
return 0;
}
else
{
return 1;
}
}
相关文档:
系统环境:Windows 7
软件环境:Visual C++ 2008 SP1 +SQL Server 2005
本次目的:编写一个航空管理系统
这是数据库课程设计的成果,虽然成绩不佳,但是作为我用VC++ 以来编写的最大程序还是传到网上,以供参考。用VC++ 做数据库设计并不容易,但也不是不可能。以下是我的程序界面,后面 ......
在类的构造函数中添加
EnableAutomation();
在OnInitDialog中添加
SetExternalDispatch(GetIDispatch(TRUE));
在类的声明中添加宏
DECLARE_DISPATCH_MAP()
在类的实现文件中添加组宏
BEGIN_DISPATCH_MAP(当前类, 基类)
END_DISPATCH_MAP()
然后就可以用 DISP_FUNCTION宏来映射导出函 ......
精短高效的XML解析器,纯C单一程序,应用于银行的国税库行横向联网接口系统中,稳定可靠,运行速度飞快,非相应的JAVA程序可比.以下为大部分源码:
/* Copyright (c) 2005 wzs */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <varargs.h>
#i ......
yeah,组合的也出来了,再一起发一个
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication32
{
class Program
{
static int s = 0;
static void Main(string[] args)
{
Console.Writ ......
在Windows 2000/XP中,"Documents and Settings"是一个特殊文件夹。用户配置文件、桌面。甚至连密钥信息都保存在这里面。如果硬盘空间不够,想把它们换个地方。但这些东西却很难移动。我们的问题是:如何在保证系统正常运行的情况下,将"Documents and Settings"文件夹移动到另外一个分区?
......