zoukankan      html  css  js  c++  java
  • 下载吧压缩工具(360超级注释压缩)

    void CAutoZipDlg::OnButton6() 
    {
        // TODO: Add your control notification handler code here
        int iArg; //命令行参数个数
        CString psz; //文件表
        CString relative; //360zip相对路径
        CString relative_zip; //存储zip的相对目录
        CString exec_str; //命令行要执行的命令字符串
     
        //要压缩的文件表
        for( iArg = 1; iArg < __argc; iArg++ )
        {
            psz = psz + "\"" + __argv[iArg] + "\""  + " ";
        //    360SZip.exe -s"\monitor_XiaZaiBa.zip" -m"model.zip" -z"psz"
        }
        //MessageBox(psz); //显示文件表
    
        //查找最后一个"\",获得360zip相对目录
        relative = __argv[0];
        relative = relative.Left(relative.ReverseFind('\\'));
        MessageBox(relative); //显示360zip相对目录
    
        //查找最后一个"\",获得存储zip相对目录
        relative_zip = __argv[1];
        //判断路径是否为目录
    
        //#include <sys\stat.h>
        //#ifndef S_ISDIR
        //#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
        //#endif
        struct stat buf; //定义stat结构体变量
        memset(&buf, 0, sizeof(struct stat)); //清零内存
        if(stat(relative, &buf) != 0)
        {
            MessageBox("Error!!!Debug 1");  //获取信息失败
        }
        //CString aa, bb, cc;
        //aa.Format("aa=%d", buf.st_mode);
        //bb.Format("bb=%d", S_IFMT);
        //cc.Format("cc=%d", (buf.st_mode) & S_IFMT); 
        //MessageBox(aa + "\n\r" + bb + "\n\r" + cc);
    
        //if(!S_ISDIR(buf.st_mode)) //st_mode最低的9位(0-8)是权限,9-11是id,12-15是类型。
        if(!((buf.st_mode) & S_IFMT) == S_IFDIR)
        {
            relative_zip = relative_zip.Left(relative_zip.ReverseFind('.')); //如果是文件则获取文件名去其后缀
        }
        MessageBox(relative_zip); //显示存储zip相对目录
    
        exec_str ="\"" + relative + "\\" + "360SZip.exe" + "\"" +  " ";
        exec_str = exec_str + "-s\"" + relative_zip + "_XiaZaiBa.zip" + "\"" + " ";
        exec_str = exec_str + "-m\"" + relative + "\\" + "model.zip" + "\"" + " ";
        exec_str = exec_str + "-z" + psz;
        exec_str = exec_str + "\"" +  relative + "\\" + "*.htm" + "\"";
        exec_str = exec_str + "& pause..."; //测试用让DOS窗口暂停
        MessageBox(exec_str); //显示命令字符串
    
        system("\"" + exec_str + "\""); //执行命令
    
        //CString str1, test;
        //str1 = "\"" + relative + "\\" + "360SZip.exe" + "\"" + " " ;
        //str1 =str1 + "-s\"monitor_XiaZaiBa.zip\" -m\"model.zip\" -z";
        //test = str1 + psz + "*.htm" + "& pause";
        //test = "\"E:\\mysvn\\vc++\\AutoZip\\Debug\\te (askdf)st\"";
        //test = test + "& pause";
        //system("\"" + test + "\"");
        //system(test);
        //system(test); 
        //MessageBox(test);
    
    }
    学习笔记转摘于: 丝酷网 http://www.pythonschool.com/
  • 相关阅读:
    pyenv: python2.7: command not found The `python2.7' command exists in these Python versions: 2.7.5
    Gazebo_02_build_a_robot
    Gazebo_01_getting_start
    vscode等编辑器中报Exception has occurred: ModuleNotFoundError No module named 'requests'
    Ubuntu16.04安装Python3.8以后出现lsb_release/No LSB modules are available的错误
    C语言字符串定义(数组&指针)
    电脑软件更新管理
    VS2017自定义新建模板
    《SQL必知必会-第四版》--学习摘抄
    实体类封装数据库查询信息(工具一)
  • 原文地址:https://www.cnblogs.com/pythonschool/p/2792994.html
Copyright © 2011-2022 走看看