📄 main.cpp
字号:
//
//-----------------------------------------------------
#include <iostream.h>
#include "czip.h"
//-----------------------------------------------------
//主程序
int main (void)
{
int c;
char source[ MAX_PATH ], target[ MAX_PATH ];
//输入原文件名
cout<< "Input The source file : ";
cin>>source;
//输入目标文件名
cout<< "Input the target file : ";
cin>>target;
//选择工作方式
cout<<"zip(1) / unzip(2) ? ";
cin>>c;
if (c!=1 && c!=2) c=1;
//开始处理文件
try
{
if (c==1)
{
CZip oZip( source );
oZip.SwapSize( target );
}
else
{
CUnzip oUnzip( source );
oUnzip.SwapSize( target );
}
}
//捕获异常
catch( CZipException e )
{
cout<<"problem : "<<e.GetString();
return -1;
}
cout<<"operation ok\n";
return 0;
}
//程序结束
//--------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -