Exemplo n.º 1
0
        // 上传文件
        private void uploadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DirNode dirNode=(DirNode)treeView1.SelectedNode.Nodes[0];
            DirectoryInfo dir = new DirectoryInfo(dirNode.getdirName());
            DirectoryInfo destination = new DirectoryInfo(dir.Name+".zip");

            ZipClass zip = new ZipClass();
            StringBuilder str = new StringBuilder(dir.FullName);
            str.Replace('\\','/');

               zip.ZipFileFromDirectory(str.ToString(), destination.FullName,1);
               fileManager.uploadFile("http://localhost/code/testfile.php", destination.Name);
               File.Delete(destination.Name);
        }
Exemplo n.º 2
0
        private void importToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // fileManager.DownLoadSoft("df", "http://localhost/xss/", "ex1.php");
            DirNode dirNode = (DirNode)treeView1.SelectedNode.Nodes[0];
            DirectoryInfo dir = new DirectoryInfo(dirNode.getdirName());
            DirectoryInfo destination = new DirectoryInfo(dir.Name + ".zip");

            fileManager.ImportFiles(@"http://localhost/code/test/"+destination.Name, "Download/"+destination.Name);

            StringBuilder str = new StringBuilder(dir.FullName);
            str.Replace('\\', '/');
            MessageBox.Show(str.ToString());

            ZipClass zip = new ZipClass();
            zip.UnZip2("Download/"+destination.Name, str.ToString());
        }