• 大小: 24KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-14
  • 语言: 其他
  • 标签:

资源简介

vs2005在线压缩、解压缩文件源码,简单实用

资源截图

代码片段和文件信息

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using System.Diagnostics;

//该源码下载自www.51aspx.com(51aspx.com)
namespace TreeRar
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender EventArgs e)
        {
            //递归展示文件目录
            string[] dir = Directory.GetDirectories(Server.MapPath(“\\“));
            Response.Write(“yle=\“color=#FFFFFF\“>目录列表:“);
            for (int i = 0; i < dir.Length; i++)
            {
                string href = dir[i];
                href = “http://“+Request.Url.Authority.ToString() + href.Substring(href.LastIndexOf(“\\“));
                Response.Write(“mouseout=\“this.style.backgroundColor=‘#ffffff‘\“   onmouseover=\“this.style.backgroundColor=‘#cccccc‘\“> “ + dir[i] + “打开“);
            }
            Response.Write(““);
            lbTree.Text = Server.MapPath(“\\“);
            //   在此处放置用户代码以初始化页面   
        }

        //得到当前IP
        private string GetIP()
        {
            string[] IP_Ary;
            string strIP strIP_list;
            strIP_list = Request.ServerVariables[“HTTP_X_FORWARDED_FOR“];
            if (strIP_list != null && strIP_list != ““)
            {
                strIP_list = strIP_list.Replace(“‘“ ““);
                if (strIP_list.IndexOf(““) >= 0)
                {
                    IP_Ary = strIP_list.Split(‘‘);
                    strIP = IP_Ary[0];
                }
                else
                {
                    strIP = strIP_list;
                }
            }
            else
            {
                strIP = ““;
            }
            if (strIP == ““)
            {
                strIP = Request.ServerVariables[“REMOTE_ADDR“];
                strIP = strIP.Replace(“‘“ ““);
            }
            return strIP;
        }


        protected void btnZip_Click(object sender EventArgs e)
        {
          //压缩
        String my51aspxRar;
        RegistryKey my51aspxReg;
        object my51aspxObj;
        String my51aspxInfo;
        ProcessStartInfo my51aspxStartInfo;
        Process my51aspxProcess;
        try
        {
            my51aspxReg = Registry.ClassesRoot.OpenSubKey(@“Applications\WinRAR.exe\Shell\Open\Command“);
            my51aspxObj = my51aspxReg.GetValue(““);
            my51aspxRar = my51aspxObj.ToString();
            my51aspxReg.Close();
            my51aspxRar = my51aspxRar.S

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     目录          0  2007-09-06 10:43  unRar

     文件       1722  2007-09-06 10:38  51aspx源码必读.txt

     文件        720  2007-09-06 09:56  Default.aspx

     文件       5248  2007-09-06 10:39  Default.aspx.cs

     文件       1910  2007-09-06 09:49  Default.aspx.designer.cs

     文件       3365  2007-09-06 09:49  TreeRar.csproj

     文件       1150  2007-09-06 09:49  TreeRar.csproj.user

     文件       1052  2007-09-06 08:51  TreeRar.sln

     文件       1263  2007-09-06 08:50  Web.config

     文件        125  2007-03-27 14:33  最新Asp.Net源码下载.url

     文件      20480  2007-09-06 10:36  bin\TreeRar.dll

     文件      15872  2007-09-06 10:36  bin\TreeRar.pdb

     目录          0  2007-09-06 08:55  bin

     目录          0  2007-09-06 10:35  obj\Debug\Refactor

     目录          0  2007-09-06 08:50  obj\Debug\TempPE

     文件      20480  2007-09-06 10:36  obj\Debug\TreeRar.dll

     文件      15872  2007-09-06 10:36  obj\Debug\TreeRar.pdb

     目录          0  2007-09-06 10:36  obj\Debug

     文件        122  2007-09-06 10:36  obj\TreeRar.csproj.FileList.txt

     目录          0  2007-09-06 08:52  obj

     文件       1397  2007-09-06 08:50  Properties\AssemblyInfo.cs

     目录          0  2007-09-06 08:50  Properties

     文件       4945  2007-07-18 09:38  rar\51aspx.gif

     文件        152  2007-09-06 10:39  rar\51aspx.rar

     文件         38  2007-09-06 10:27  rar\51aspx.txt

     目录          0  2007-09-06 10:43  rar

----------- ---------  ---------- -----  ----

                95913                    26


评论

共有 条评论

相关资源