代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
CSharp
】
压缩解压rar文档,兼容zip,服务器端需安装
作者:
Dezai.CN
/ 发布于
2011/6/30
/
485
<div><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> System; </span><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> System.Diagnostics; </span><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> System.IO; </span><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> System.Text; </span><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> Microsoft.Win32; </span><span style="color: rgb(0,0,255)">namespace</span><span style="color: rgb(0,0,0)"> Coffeefox.Tools.CompressFile { </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 压缩解压rar文档,兼容zip,服务器端需安装winrar </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">partial</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">class</span><span style="color: rgb(0,0,0)"> RARCompress { </span><span style="color: rgb(0,0,255)">#region</span><span style="color: rgb(0,0,0)"> 覆盖压缩</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 压缩,覆盖同名目标文件,不分卷 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 目标文件以源文件夹或源文件名命名,保存于源文件/文件夹的同级目录下 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="toCompress"></span><span style="color: rgb(0,128,0)">要压缩的文件夹或文件名,文件夹后可加通配符匹配某类文件,如D:\\*.xls表示D盘根目录下的xls文件。</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> Compress(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> toCompress) { Compress(toCompress, toCompress, </span><span style="color: rgb(0,0,255)">false</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 压缩,覆盖同名目标文件,不分卷 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="toCompress"></span><span style="color: rgb(0,128,0)">要压缩的文件夹或文件名,文件夹后可加通配符匹配某类文件,如D:\\*.xls表示D盘根目录下的xls文件。</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="compressedFileFullPath"></span><span style="color: rgb(0,128,0)">最终压缩文件的完整路径,不加rar后缀名则以最后一级文件夹命名</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> Compress(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> toCompress, </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> compressedFileFullPath) { Compress(toCompress, compressedFileFullPath, </span><span style="color: rgb(0,0,255)">false</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(0,0,255)">#endregion</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">#region</span><span style="color: rgb(0,0,0)"> 追加压缩</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 追加压缩,不可分卷 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 目标文件以源文件夹或源文件名命名,保存于源文件/文件夹的同级目录下 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="toCompress"></span><span style="color: rgb(0,128,0)">要压缩的文件夹或文件名,文件夹后可加通配符匹配某类文件,如D:\\*.xls表示D盘根目录下的xls文件。</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> CompressAdditional(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> toCompress) { CompressAdditional(toCompress, toCompress); } </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 追加压缩,不可分卷 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="toCompress"></span><span style="color: rgb(0,128,0)">要压缩的文件夹或文件名,文件夹后可加通配符匹配某类文件,如D:\\*.xls表示D盘根目录下的xls文件。</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="compressedFileFullPath"></span><span style="color: rgb(0,128,0)">最终压缩文件的完整路径,不加rar后缀名则以最后一级文件夹命名</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> CompressAdditional(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> toCompress, </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> compressedFileFullPath) { Compress(toCompress, compressedFileFullPath, </span><span style="color: rgb(0,0,255)">true</span><span style="color: rgb(0,0,0)">, </span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(0,0,255)">#endregion</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">#region</span><span style="color: rgb(0,0,0)"> 分卷压缩</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 分卷压缩,覆盖同名目标文件,无法追加 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 目标文件以源文件夹或源文件名命名,保存于源文件/文件夹的同级目录下 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="toCompress"></span><span style="color: rgb(0,128,0)">要压缩的文件夹或文件名,文件夹后可加通配符匹配某类文件,如D:\\*.xls表示D盘根目录下的xls文件。</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="sizeLimit"></span><span style="color: rgb(0,128,0)">指定大小则按照大小分卷压缩,单位为M,0表示不分卷</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> Compress(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> toCompress, </span><span style="color: rgb(0,0,255)">int</span><span style="color: rgb(0,0,0)"> sizeLimit) { Compress(toCompress, toCompress, sizeLimit); } </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 分卷压缩,覆盖同名目标文件,无法追加 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="toCompress"></span><span style="color: rgb(0,128,0)">要压缩的文件夹或文件名,文件夹后可加通配符匹配某类文件,如D:\\*.xls表示D盘根目录下的xls文件。</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="compressedFileFullPath"></span><span style="color: rgb(0,128,0)">最终压缩文件的完整路径,不加rar后缀名则以最后一级文件夹命名</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="sizeLimit"></span><span style="color: rgb(0,128,0)">指定大小则按照大小分卷压缩,单位为M,0表示不分卷</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> Compress(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> toCompress, </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> compressedFileFullPath, </span><span style="color: rgb(0,0,255)">int</span><span style="color: rgb(0,0,0)"> sizeLimit) { Compress(toCompress, compressedFileFullPath, </span><span style="color: rgb(0,0,255)">false</span><span style="color: rgb(0,0,0)">, sizeLimit); } </span><span style="color: rgb(0,0,255)">#endregion</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 压缩 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="toCompress"></span><span style="color: rgb(0,128,0)">要压缩的文件夹或文件名,文件夹后可加通配符匹配某类文件,如D:\\*.xls表示D盘根目录下的xls文件。分卷压缩可在前-v[n]m</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="compressedFileFullPath"></span><span style="color: rgb(0,128,0)">最终压缩文件的完整路径</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="superAddition"></span><span style="color: rgb(0,128,0)">存在同名压缩文件时,true=追加,false=覆盖</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="sizeLimit"></span><span style="color: rgb(0,128,0)">指定大小则按照大小分卷压缩,单位为M,0表示不分卷</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">private</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> Compress(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> toCompress, </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> compressedFileFullPath, </span><span style="color: rgb(0,0,255)">bool</span><span style="color: rgb(0,0,0)"> superAddition, </span><span style="color: rgb(0,0,255)">int</span><span style="color: rgb(0,0,0)"> sizeLimit) { </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源与目的,如果为路径都将最后的反斜杠去掉</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (toCompress.EndsWith(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">\\</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">)) { toCompress </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> toCompress.Substring(</span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">, toCompress.Length </span><span style="color: rgb(0,0,0)">-</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,128)">1</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (compressedFileFullPath.EndsWith(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">\\</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">)) { compressedFileFullPath </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> compressedFileFullPath.Substring(</span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">, compressedFileFullPath.Length </span><span style="color: rgb(0,0,0)">-</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,128)">1</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源不存在--异常</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">bool</span><span style="color: rgb(0,0,0)"> toCompressDirectoryExists </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Directory.Exists(toCompress); </span><span style="color: rgb(0,0,255)">bool</span><span style="color: rgb(0,0,0)"> toCompressFileExists </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> File.Exists(toCompress); </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">toCompressDirectoryExists </span><span style="color: rgb(0,0,0)">&&</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">toCompressFileExists) { </span><span style="color: rgb(0,0,255)">throw</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> FileNotFoundException(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">待压缩源路径或文件不存在</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)">[] filesToDelete </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)">[</span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">]; </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">分卷压缩-删除可能存在的分卷 </span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (sizeLimit </span><span style="color: rgb(0,0,0)">></span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">) { </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> filename </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Path.GetFileNameWithoutExtension(compressedFileFullPath); </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源与目的相同</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (toCompress.Equals(compressedFileFullPath)) { filesToDelete </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Directory.GetFiles(Path.GetDirectoryName(toCompress), filename </span><span style="color: rgb(0,0,0)">+</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">.part*.rar</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">, SearchOption.TopDirectoryOnly); } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源与目的不同</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> { filesToDelete </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Directory.GetFiles(Path.GetDirectoryName(compressedFileFullPath), filename </span><span style="color: rgb(0,0,0)">+</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">.part*.rar</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">, SearchOption.TopDirectoryOnly); } } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">非分卷且目的存在并选择覆盖--删除原存压缩文件</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> { </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">superAddition </span><span style="color: rgb(0,0,0)">&&</span><span style="color: rgb(0,0,0)"> toCompressFileExists) { filesToDelete </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)">[</span><span style="color: rgb(128,0,128)">1</span><span style="color: rgb(0,0,0)">] { compressedFileFullPath }; } } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">执行删除</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (filesToDelete.Length </span><span style="color: rgb(0,0,0)">></span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">) { </span><span style="color: rgb(0,0,255)">foreach</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> s </span><span style="color: rgb(0,0,255)">in</span><span style="color: rgb(0,0,0)"> filesToDelete) { File.Delete(s); } } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源与目的相同</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (toCompress.Equals(compressedFileFullPath)) { </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源是文件,用源文件命名,与源文件同级目录保存 </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源是目录,以源最后级目录名命名,源目录上级目录保存</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> compressedFileFullPath </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Path.Combine(Path.GetDirectoryName(toCompress), Path.GetFileNameWithoutExtension(toCompress)); } </span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> { </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">目的是路径 </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源是文件,用源文件命名,与源文件同级目录保存 </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">源是目录,以源最后级目录名命名,源目录上级目录保存 </span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)">.IsNullOrEmpty(Path.GetExtension(compressedFileFullPath))) { compressedFileFullPath </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Path.Combine(compressedFileFullPath, Path.GetFileNameWithoutExtension(toCompress)); } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">目的是文件掠过</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">添加.rar后缀名--文件名指定错误的,由此生成错误文件名.rar</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)">.IsNullOrEmpty(Path.GetExtension(compressedFileFullPath)) </span><span style="color: rgb(0,0,0)">||</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">Path.GetExtension(compressedFileFullPath).ToLower().Equals(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">.rar</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">)) { compressedFileFullPath </span><span style="color: rgb(0,0,0)">+=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">.rar</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">; } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">保存的路径不存在就创建路径 </span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> saveFileDirectory </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Path.GetDirectoryName(compressedFileFullPath); </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">Directory.Exists(saveFileDirectory)) { Directory.CreateDirectory(saveFileDirectory); } String rarObjStr; RegistryKey rarRegKey; Object rarObj; StringBuilder commandInfo </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> StringBuilder(); ProcessStartInfo processInfo; Process process; rarRegKey </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Registry.ClassesRoot.OpenSubKey(</span><span style="color: rgb(128,0,0)">@"</span><span style="color: rgb(128,0,0)">WinRAR\Shell\Open\Command</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); rarObj </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarRegKey.GetValue(</span><span style="color: rgb(128,0,0)">""</span><span style="color: rgb(0,0,0)">); rarObjStr </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarObj.ToString(); rarRegKey.Close(); rarObjStr </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarObjStr.Substring(</span><span style="color: rgb(128,0,128)">1</span><span style="color: rgb(0,0,0)">, rarObjStr.Length </span><span style="color: rgb(0,0,0)">-</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,128)">7</span><span style="color: rgb(0,0,0)">); commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)"> a </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">);</span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">压缩</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">File.Exists(toCompress))</span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">非文件-处理所有子文件夹</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> { commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)"> -r </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (sizeLimit </span><span style="color: rgb(0,0,0)">></span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,128)">0</span><span style="color: rgb(0,0,0)">)</span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">分卷压缩</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> { commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">-v</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); commandInfo.Append(sizeLimit.ToString()); commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">m </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); } commandInfo.Append(compressedFileFullPath); commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)"> </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); commandInfo.Append(toCompress); processInfo </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> ProcessStartInfo(); processInfo.FileName </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarObjStr; processInfo.Arguments </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> commandInfo.ToString(); processInfo.WindowStyle </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> ProcessWindowStyle.Hidden; processInfo.WorkingDirectory </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> toCompress; process </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> Process(); process.StartInfo </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> processInfo; process.Start(); process.WaitForExit(); } } } </span> </div> <div></div> <div></div> <div></div> <div></div> <div><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> System; </span><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> System.Diagnostics; </span><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> System.IO; </span><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> System.Text; </span><span style="color: rgb(0,0,255)">using</span><span style="color: rgb(0,0,0)"> Microsoft.Win32; </span><span style="color: rgb(0,0,255)">namespace</span><span style="color: rgb(0,0,0)"> Coffeefox.Tools.CompressFile { </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">partial</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">class</span><span style="color: rgb(0,0,0)"> RARCompress { </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 解压缩 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="rarFileFullPath"></span><span style="color: rgb(0,128,0)">待压缩文件</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="overwrite"></span><span style="color: rgb(0,128,0)">true为覆盖已存同名文件,false为跳过</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> UnCompress(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> rarFileFullPath, </span><span style="color: rgb(0,0,255)">bool</span><span style="color: rgb(0,0,0)"> overwrite) { UnCompress(rarFileFullPath, rarFileFullPath, overwrite); } </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> 解压缩 </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"></summary></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="rarFileFullPath"></span><span style="color: rgb(0,128,0)">待压缩文件</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="unCompressPath"></span><span style="color: rgb(0,128,0)">目的文件夹</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)">///</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(128,128,128)"><param name="overwrite"></span><span style="color: rgb(0,128,0)">true为覆盖已存同名文件,false为跳过</span><span style="color: rgb(128,128,128)"></param></span><span style="color: rgb(128,128,128)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">public</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">static</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">void</span><span style="color: rgb(0,0,0)"> UnCompress(</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> rarFileFullPath, </span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)"> unCompressPath, </span><span style="color: rgb(0,0,255)">bool</span><span style="color: rgb(0,0,0)"> overwrite) { </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,255)">string</span><span style="color: rgb(0,0,0)">.IsNullOrEmpty(unCompressPath)) { unCompressPath </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarFileFullPath; } </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">rarFileFullPath.EndsWith(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">.rar</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">) </span><span style="color: rgb(0,0,0)">&&</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">File.Exists(rarFileFullPath)) { </span><span style="color: rgb(0,0,255)">throw</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> FileNotFoundException(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)">源文件不存在</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">if (unCompressPath.EndsWith("\\")) { unCompressPath = unCompressPath.Substring(0, unCompressPath.Length - 1); } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">解压文件与目标相同-取出解压文件所在文件夹作为目标</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (rarFileFullPath.Equals(unCompressPath)) { unCompressPath </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Path.GetDirectoryName(rarFileFullPath); } </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (</span><span style="color: rgb(0,0,0)">!</span><span style="color: rgb(0,0,0)">Directory.Exists(unCompressPath)) { Directory.CreateDirectory(unCompressPath); } </span><span style="color: rgb(0,128,0)">//</span><span style="color: rgb(0,128,0)">解压缩</span><span style="color: rgb(0,128,0)"> </span><span style="color: rgb(0,0,0)"> String rarObjStr; RegistryKey rarRegKey; Object rarObj; StringBuilder commandInfo </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> StringBuilder(); ProcessStartInfo processInfo; Process process; rarRegKey </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> Registry.ClassesRoot.OpenSubKey(</span><span style="color: rgb(128,0,0)">@"</span><span style="color: rgb(128,0,0)">WinRAR\Shell\Open\Command</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); rarObj </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarRegKey.GetValue(</span><span style="color: rgb(128,0,0)">""</span><span style="color: rgb(0,0,0)">); rarObjStr </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarObj.ToString(); rarRegKey.Close(); rarObjStr </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarObjStr.Substring(</span><span style="color: rgb(128,0,128)">1</span><span style="color: rgb(0,0,0)">, rarObjStr.Length </span><span style="color: rgb(0,0,0)">-</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(128,0,128)">7</span><span style="color: rgb(0,0,0)">); commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)"> x </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); </span><span style="color: rgb(0,0,255)">if</span><span style="color: rgb(0,0,0)"> (overwrite) { commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)"> -o+ </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); } </span><span style="color: rgb(0,0,255)">else</span><span style="color: rgb(0,0,0)"> { commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)"> -o- </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); } commandInfo.Append(rarFileFullPath); commandInfo.Append(</span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(128,0,0)"> </span><span style="color: rgb(128,0,0)">"</span><span style="color: rgb(0,0,0)">); commandInfo.Append(unCompressPath); processInfo </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> ProcessStartInfo(); processInfo.FileName </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> rarObjStr; processInfo.Arguments </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> commandInfo.ToString(); processInfo.WindowStyle </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> ProcessWindowStyle.Hidden; process </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> </span><span style="color: rgb(0,0,255)">new</span><span style="color: rgb(0,0,0)"> Process(); process.StartInfo </span><span style="color: rgb(0,0,0)">=</span><span style="color: rgb(0,0,0)"> processInfo; process.Start(); process.WaitForExit(); } } } </span> </div> <div></div>
试试其它关键字
压缩解压rar文档
同语言下
.
文件IO 操作类库
.
Check图片类型[JPEG(.jpg 、.jpeg),TIF,GIF,BMP,PNG,P
.
机器名和IP取得(IPV4 IPV6)
.
Tiff转换Bitmap
.
linqHelper
.
MadieHelper.cs
.
RegHelper.cs
.
如果关闭一个窗体后激活另一个窗体的事件或方法
.
创建日志通用类
.
串口辅助开发类
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
Dezai.CN
贡献的其它代码
(
4037
)
.
多线程Socket服务器模块
.
生成随机密码
.
清除浮动样式
.
弹出窗口居中
.
抓取url的函数
.
使用base HTTP验证
.
div模拟iframe嵌入效果
.
通过header转向的方法
.
Session操作类
.
执行sqlite输入插入操作后获得自动编号的ID
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3