ASP automatically extracts the RAR file

xiaoxiao2021-03-06  62

In fact, it is very simple to implement this feature. First, you need to upload a RAR decompression program, that is, Rar's own decompression program, just need its core program rar.exe. This file is OK. Then you have to upload a program cmd.exe that executes rar.exe is the program in Windows (don't you have to say more). Finally, these programs are started. Look at the following code

Program code: <% DIM YLJ, YWJ, MLPATH, Shell, Rarcomm, Retcode, CMD, Comm, Fsomlpath = "E: / Page / Mian /" Store Rar.exe and cmd.exe path YLJ = Server.mAppath ( "Mian") & "/" 'Different the path placed after the file ywj = server.mappath ("mian / apathy.rar")' To decompress the RAR file set shell = server.createObject ("wscript.shell") RARCOMM = "E: /PAGE / MIAN/CMD.EXE / C" & mlpath & "rar.exe x -t -o -p-" cmd = RARCOMM & YWJ & "& YLJRETCODE = shell.run (cmd, 1, true)%> is used Server.createObject ("wscript.shell") to perform cmd.exe to run the RAR.exe file to extract the RAR file. I didn't know if there was a predecessor to publish these articles, but the brother is interested in achieving many similarly similar to such a program, I hope you can find some better ways.

转载请注明原文地址:https://www.9cbs.com/read-84519.html

New Post(0)