- WinCE Security...
 - xdebug配置说明
 - VC++ 获取文件的创建、修...
 - ASP进度条
 - 简单代理服务器C代码实现(S...
 - 程序设计竞赛试题选(02)
 - 如何在ASP程序中打印Acc...
 - UTF-8和16进制区间
 - ASP实用技巧:强制刷新和判...
 - 运行中程序删除自己的方法
 - asp提高首页性能的一个技巧
 - [J2EE]J2EE 应用服务器技术
 - VB变量命名规范
 - C语言常见错误小结
 - (摘自网络)如何在IIS中调...
 
合并文件程序
 /*** 
               运行程序时,如果编绎成的可执行文件名为fadd.exe
               则 命令行:例如 fadd file#nnn
      主意:输入" file#nnn " ,而不是 " file#nnn.001 " ***/
 /*** 当分快文件少于 32 块时,可以不用此程序,
        直接运行分割时生成的披拷贝文件即可 ***/
 #include<stdio.h>
 main(int argc,char **argv)
  {
   FILE *fp_read,*fp_write;
   int buffer=0,i,len,pc_fn=1;
   char *fn_in,fn_out[50],*p=".001",ch='#';
   if (argc==1)
    {
     printf ("\n ERROR! you fogot enter the file name   ( file#nnn )\n");
     exit (0);
    }
   fn_in=argv[1];
   i=0;               /*** file#nnn ---> file.nnn 得到目标文件名 ***/
   while (*(fn_in+i))
    {
     if (*(fn_in+i)=='#') *(fn_out+i)='.'; else *(fn_out+i)=*(fn_in+i); i++;
    }
   *(fn_out+i)='\0';
   strcat (fn_in,p); len=strlen (fn_in);  /*** file#nnn ---> file#nnn.01 ***/
   if ((fp_read=fopen (fn_in,"rb"))==NULL)   /*** 检测块文件是否存在***/
    { printf ("\n ERROR! the file \" %s \" not exsits\n",fn_in); exit (0); }
/*** 检测目标文件是否已经存在。如果存在,交出"控制权" ***/
   if ((fp_write=fopen(fn_out,"rb"))!=NULL)
    {
     fclose (fp_write);
     printf ("\n OVERWRITE the file \" %s \"  (Y/N)?",fn_out);
     while (ch!='N'&&ch!='n'&&ch!='Y'&&ch!='y')
      {
       ch=getche();
       if (ch=='Y'||ch=='y') break;
       if (ch=='N'||ch=='n') { printf ("\n"); exit (0); }
      }
     printf ("\n");
    }
/*** 合并 ***/ /*** 第一个块文件已在前面检测时打开 ***/
   fp_write=fopen(fn_out,"wb");  /*** 建立目标文件 ***/
   while (fp_read)        /*** 块文件不能被打开 (不存在 ) 时,停下 ***/
    {
     fread (&buffer,1,1,fp_read);
     while (!feof(fp_read))
      {
       fwrite (&buffer,1,1,fp_write); fread (&buffer,1,1,fp_read);
      }
     fclose (fp_read);
     pc_fn++;
     if (pc_fn%10==0&&pc_fn%100!=0)
      { *(fn_in+len-2)+=1; *(fn_in+len-1)-=9; }
      else if (pc_fn%100!=0) *(fn_in+len-1)+=1;
     if (pc_fn%100==0) { *(fn_in+len-3)+=1; *(fn_in+len-2)-=9; *(fn_in+len-1)-=9; }
      fp_read=fopen(fn_in,"rb");
    }
   fclose (fp_read);  fclose (fp_write);
  printf ("\n OK! the file \" %s \"  be created successfuly\n",fn_out);
  printf ("\n %d  files been added\n",pc_fn-1);
 }