提取当前目录下的文件全名-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3977288
  • 博文数量: 536
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4825
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(536)

文章存档

2024年(3)

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(252)

2006年(73)

分类:

2007-10-16 15:28:07

os :
microsoft windows 2000 [version 5.00.2195]
(c) 凯发k8官网下载客户端中心的版权所有 1985-2000 microsoft corp.

===================

#include <windows.h>
#include <stdio.h>

#define bufsize 4096

int main(int argc, char *argv[])
{
    dword retval = 0;
    bool success;
    char buffer[bufsize] = "";
    char *lppart[bufsize] = {null};

   /*
retrieve a full path name for a file. the file does not need to exist.

提取文件的全名
  如: 当前目录下的aa.c文件(当前目录为c:\win32),那么就可以得到为"c:\win32\aa.c"
    */

    retval = getfullpathname("t1.c", bufsize, buffer, null);
    if (retval == 0)
    {
        // handle an error condition.

        printf ("getfullpathname failed with error %d.\n", getlasterror());
        return (1);
    }
    else
        printf("the full path name for the file test.txt is: %s\n", buffer);


   // create a long directory name for use with the next two examples.

   success = createdirectory("c:\\longdirectoryname", null); // no security attributes.

   if (!success)
   {
      // handle an error condition.

      printf ("createdirectory failed with error %d.\n", getlasterror());
      return (1);
   }

   // retrieve the short path name.

   retval = getshortpathname("c:\\longdirectoryname", buffer, bufsize);
   if (retval == 0)
   {
      // handle an error condition.

       printf ("getshortpathname failed with error %d.\n", getlasterror());
       return (1);
   }
   else
       printf("the short path name for the directory "
              "c:\\longdirectoryname is: %s\n", buffer);

   // retrieve the long path name.

   retval = getlongpathname("c:\\longdi~1", buffer, bufsize);
   if (retval == 0)
   {
       // handle an error condition.

       printf ("getlongpathname failed with error %d.\n", getlasterror());
       return (1);
   }
   else
      printf("the long path name for the directory "
             "c:\\longdirectoryname is: %s\n", buffer);

   // clean up the directory.

    success = removedirectory("c:\\longdirectoryname");
    if (!success)
    {
        // handle an error condition.

        printf ("removedirectory failed with error %d.\n", getlasterror());
        return (1);
    }
}

阅读(2087) | 评论(0) | 转发(0) |
0

上一篇:qt学习

下一篇:可变参数宏的使用

给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图