谁有麻烦给我一份[email protected]
没有也可提供相关资料
先谢谢

解决方案 »

  1.   

    asp.net源码下载http://down.vv66.com/sort/141_1.htm
      

  2.   

    怎么还没人来,楼上的是asp的
      

  3.   

    这是一个很简单的文件管理器,楼主可以参考之。
    把代码拷到aspx文件中,放到虚拟目录下,
    然后在虚拟目录中建立Images目录,下面放4个图片:
    file.unrecognizable.gif
    folder.big.gif
    folder.small.gif
    folder.up.gif

    然后浏览之:
      

  4.   

    <%@ Page Language="c#" %>
    <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>File Maintain System</title>
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
    <base target=_self />
    <script runat="server">    //Messages
        private string noFileMessage = "You must select a file!";
        private string uploadSuccessMessage = "Upload success!";
        private string uploadFailureMessage = "Upload failed!";
        private string noImagesMessage = "The folder is not exist or it is empty.";
        private string noFolderSpecifiedMessage = "The target folder is not exist.";
        private string noFileToDeleteMessage = "You must select a file to delete.";
        private string noFolderToDeleteMessage = "You must select a folder to delete.";
        private string invalidFileTypeMessage = "The type of the file you upload is not allowed.";
        private string validFileTypePromptMessage = "Allowed filetype is {0}";//
        private string noFolderNameMessage = "You must provide a folder name!";    private string acceptedFileTypes = "*.*;";
        private string acceptedImageFileTypes = "*.jpg|*.jpeg|*.jpe|*.gif|*.png|*.bmp;";    //Configuration
        private bool uploadIsEnabled = true;         //whether allow upload file.
        private bool deleteIsEnabled = true;         //whether allow delete file.
        private string rootFolder = "userdata";  //Initial folder.
        private string validFileTypeString = "Allowed filetype is {0}";    private void Page_Load(object sender, System.EventArgs e)
        {
    try
    {
    CurrentFolder.Value = "" + Request["folder"]; string userRoot = 
    System.IO.Path.Combine
    (
    HttpContext.Current.Request.PhysicalApplicationPath,
    rootFolder + "\\" + this.Context.User.Identity.Name
    ); string currentPath = 
    System.IO.Path.GetFullPath
    (
    System.IO.Path.Combine
    (
    userRoot,
    CurrentFolder.Value
    )
    );     btnDeleteFile.Attributes.Add("onclick", "return confirm('" + "Are u sure you want to delete the selected file(s)?" + "');");
                btnDeleteFolder.Attributes.Add("onclick", "return confirm('" + "Are u sure you want to delete the selected folder(s)?" + "');");            FileValidator.ValidationExpression = string.Format(@"({0})$", System.Text.RegularExpressions.Regex.Replace(acceptedFileTypes, @";.*", string.Empty).Replace(".", "\\.").Replace("*", ".*"));
                
    FileValidator.ErrorMessage = validFileTypeString; if(!System.IO.Directory.Exists(userRoot))
    {
    System.IO.Directory.CreateDirectory(userRoot);
    } if(!IsPostBack)
    {
    DisplayFiles();
    }
    }
    catch(System.Exception)// ex)
    {
    //MessageBox.Show(ex.Message);
    }
        }    public void btnUpload_OnClick(object sender, EventArgs e)
        {
            if(Page.IsValid)
            {
                if(UploadFile.PostedFile.FileName.Trim() != "")
                {
                    if(IsValidFileType(UploadFile.PostedFile.FileName))
                    {
                        try
                        {
                            string uploadFileName = "";
                            string uploadFileDestination = "";
                            uploadFileName = UploadFile.PostedFile.FileName;
                            uploadFileName = uploadFileName.Substring(uploadFileName.LastIndexOf("\\")+1);
                            uploadFileDestination = HttpContext.Current.Request.PhysicalApplicationPath;
                            uploadFileDestination += this.rootFolder + "\\" + this.Context.User.Identity.Name + "\\" + CurrentFolder.Value;
                            uploadFileDestination += "\\";
                            UploadFile.PostedFile.SaveAs(uploadFileDestination + uploadFileName);
                            resultsMessage.Text = uploadSuccessMessage;
                        }
                        catch(System.Exception)
                        {
                            //resultsMessage.Text = "Your file could not be uploaded: " + ex.Message;
                            resultsMessage.Text = uploadFailureMessage;
                        }
                    }
                    else
                    {
                        resultsMessage.Text = invalidFileTypeMessage + "\n" + validFileTypeString;
    }
                }
                else
                {
                    resultsMessage.Text = noFileMessage;
                }
            }
            else
            {
                resultsMessage.Text = invalidFileTypeMessage;        }
            DisplayFiles();
        }
        
        public void btnDeleteFile_OnClick(object sender, EventArgs e)
        {
            if(FileToDelete.Value != "" && FileToDelete.Value != "undefined")
            {
                try
                {
                    string appPath = HttpContext.Current.Request.PhysicalApplicationPath;
    System.IO.File.Delete(appPath + this.rootFolder + "\\" + this.Context.User.Identity.Name + "\\"  + CurrentFolder.Value + "\\" + FileToDelete.Value);
                    resultsMessage.Text = FileToDelete.Value + " was deleted";
                }
                catch(System.Exception ex)
                {
                    resultsMessage.Text = "Delete failed." + this.Server.HtmlDecode(ex.Message);
                }
            }
            else
            {
                resultsMessage.Text = noFileToDeleteMessage;
            }        DisplayFiles();
        }    public void btnCreateFolder_OnClick(object sender, EventArgs e)
        {
            if(txtDirectory.Value != "" && txtDirectory.Value != "undefined")
            {
                try
                {
    string folderName = txtDirectory.Value;
                    string appPath = HttpContext.Current.Request.PhysicalApplicationPath;
                    string fullPath = appPath + this.rootFolder + "\\" + this.Context.User.Identity.Name + "\\" + CurrentFolder.Value + "\\" + folderName;                System.IO.Directory.CreateDirectory(fullPath);                resultsMessage.Text = (appPath + this.rootFolder + "\\" + this.Context.User.Identity.Name + "\\" + CurrentFolder.Value + "\\" + folderName + " was created.").Replace("\\\\", "\\");
                }
                catch(System.Exception)
                {
                    resultsMessage.Text = "Create failed.";
                }
            }
            else
            {
                resultsMessage.Text = noFolderNameMessage;
            }
            DisplayFiles();
        }
      

  5.   


    public void btnDeleteFolder_OnClick(object sender, EventArgs e)
    {
            if(FolderToDelete.Value != "" && FolderToDelete.Value != "undefined")
            {
                try
                {
                    string appPath = HttpContext.Current.Request.PhysicalApplicationPath;
                    string fullPath = appPath + this.rootFolder + "\\" + this.Context.User.Identity.Name + "\\" + CurrentFolder.Value + "\\" + FolderToDelete.Value;                System.IO.Directory.Delete(fullPath, true);                resultsMessage.Text = fullPath + " was deleted";
                }
                catch(System.Exception)
                {
                    resultsMessage.Text = "Delete failed.";
                }
            }
            else
            {
                resultsMessage.Text = noFolderToDeleteMessage;
            }
            DisplayFiles();
    }    private bool IsValidFileType(string fileName)
        {
    if(acceptedFileTypes.IndexOf(".*") != -1)
    {
    return true;
    }
    else
    {
    System.IO.FileInfo fi = new System.IO.FileInfo(fileName);
    if(acceptedFileTypes.IndexOf(fi.Extension.ToLower()) != -1)
    {
    return true;
    }
    }        return false;
        }
        
        private string[] GetFilesArray()
        {
            try
            {
    string folderPath =
    System.IO.Path.Combine
    (
    System.IO.Path.Combine
    (
    HttpContext.Current.Request.PhysicalApplicationPath,
    rootFolder + "\\" + this.Context.User.Identity.Name
    ),
    CurrentFolder.Value
    );            string[] filesArray = System.IO.Directory.GetFiles(folderPath, "*"); return filesArray;
            }
            catch(System.Exception)
            {
                return null;
            }
        }    private string[] GetDirectoriesArray()
        {
            try
            {
    string folderPath =
    System.IO.Path.Combine
    (
    System.IO.Path.Combine
    (
    HttpContext.Current.Request.PhysicalApplicationPath,
    rootFolder + "\\" + this.Context.User.Identity.Name
    ),
    CurrentFolder.Value
    );            string[] directoriesArray = System.IO.Directory.GetDirectories(folderPath, "*");
                return directoriesArray;
            }
            catch(System.Exception)
            {
                return null;
            }
        }