/*
文件名:cpyimg.cpp 【相关文章:ASP TreeView 2.0 版 发】 【扩展阅读:[原创]评说eclipse的优缺点 】 平台: win2k sp4+vc6 【扩展信息:HTML标准及工具】 作者:vicallee 版本:1.0 完成日期:2004-9-10 描述:1. 把当前目录下的六个文件复制到指定目录下的某些目录, 复制的条件是:此目录下有001.htm. 2.修改001.htm与top.htm,把它们中的"../"变为" ./" 3.把top.htm中的<td><img src=" ./images/new_gz开头的部分,它后面的两个字母改为dl */ #include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> #include <windows.h> const char *mfile[] = {"\\a1.jpg", "\\new_01.gif", "\\new_02.gif", "\\new_03.gif", "\\new_gzdl.gif", "\\tb.jpg"}; typedef struct sstack{ char *path; struct sstack *next; }mystack;static mystack *head = null;
void push(const char *path);
bool pop(char *s); bool cpfile(char *dest, char *src); bool modify(char *filename);int main(int argc, char* argv[])
{ char path[max_path], pathcurr[max_path], imgpath[max_path]; win32_find_data sr; handle hfind;if (argc < 2 )
{ printf("请带上目录名作参数!\n"); return 1; } push(strcat(strcpy(path, argv[1]), "\\")); while(pop(path)) { strcat(strcpy(pathcurr, path), "*.*"); if ((hfind = findfirstfile(pathcurr, &sr)) == invalid_handle_value) { ... 下一页