Compression | Have you ever thought about extracting compressed files online? Oh, sometimes upload a compressed package, the use of ASP program decompression is indeed very convenient, especially the webmaster who often update the site, because the text file compression ratio is large, so the use of compression after the upload and then decompression, so more than direct upload to save a lot of valuable time. You ready? Let's keep it up.
In order to achieve this function, first of all to get a RAR program to extract the core file support (can download winrar software, and then the WinRar.exe file alone "take" out. And also requires a Cmd.exe program from the Windows operating system that is used to execute the WinRar.exe file. The operating system is self-contained, the NT kernel operating system can be found under the System32 folder under the operating system installation directory, and the Windows 9X operating system can be found under the System folder under the OS installation directory. ), as shown in Figure 1. Then upload them to the same directory. To create an ASP file, see the following code:
<%
Dim A,b,main,shell,runing,runcode,cmd,comm,fso
Main= "D:\chencheng\rar" after uploading Winrar.exe and Cmd.exe after the path.
A=server.mappath ("rar") & "" "Extract rar files after the storage path.
B=server.mappath ("Rar\homepage.rar") ' to extract the RAR file, which Homepage.rar modified to need to extract the file.
Set Shell = Server.CreateObject ("Wscript.Shell")
runing= "d:\chencheng\rar\cmd.exe/c" &Main& "Winrar.exe x-t-o+-p-" sets the command to run the decompression.
cmd=run&b& "" &a
RunCode = Shell.run (cmd,1, True)
%>
<div align=center></div>
You can use it when you upload it to your space. Isn't it convenient? It's very simple, too.