예제 #1
0
 public void DeleteFileAndDirectory(ArrayList deleteFileNameList, string remotePath)
 {
     foreach (string fileName in deleteFileNameList)
     {
         string fileRemotePath = SFUCommon.CombinePath4Web(remotePath, fileName);
         upYun.deleteFile(fileRemotePath);
     }
 }
예제 #2
0
        private void menuItemCopyLink4Remote_Click(object sender, EventArgs e)
        {
            Point        listView4RemotePoint = listView4Remote.PointToClient(tempPoint);
            ListViewItem selectedItem         = listView4Remote.GetItemAt(listView4RemotePoint.X, listView4RemotePoint.Y);
            string       selectedItemText     = selectedItem.Text;
            string       webLink = SFUCommon.CombinePath4Web(remotePath, selectedItemText);
            string       testStr = SFUCommon.CombinePath4Web(sfuConfigInfo.operatorInfo.bindDomain, webLink);

            Clipboard.SetDataObject(SFUCommon.CombinePath4Web(sfuConfigInfo.operatorInfo.bindDomain, webLink));
        }
        private void btnOK_Click(object sender, EventArgs e)
        {
            string inputNewName = textBoxName.Text.Trim();
            bool   retVal       = false;

            if (inputNewName.Length <= 0)
            {
                return;
            }
            if (inputOperaType.Equals("LOCAL"))
            {
                if (inputFileOrFolder.Equals("FILE"))
                {
                    if (inputAddOrRename.Equals("ADD"))
                    {
                        retVal = localBrowserBusi.NewFile(inputCurrPath, inputNewName);
                    }
                    else
                    {
                        retVal = localBrowserBusi.RenameFile(inputCurrPath, inputOriName, inputNewName);
                    }
                }
                else
                {
                    if (inputAddOrRename.Equals("ADD"))
                    {
                        retVal = localBrowserBusi.NewFolder(inputCurrPath, inputNewName);
                    }
                    else
                    {
                        retVal = localBrowserBusi.RenameFolder(inputCurrPath, inputOriName, inputNewName);
                    }
                }
            }
            else
            {
                if (inputFileOrFolder.Equals("FOLDER"))
                {
                    string newFolderPath = SFUCommon.CombinePath4Web(inputCurrPath, inputNewName);
                    retVal = remoteBrowserBusi.NewFolder(newFolderPath, true);
                }
            }
            if (retVal == true)
            {
                this.Close();
            }
        }
예제 #4
0
        private void listView4Remote_DoubleClick(object sender, EventArgs e)
        {
            ListViewItem selectedItem = listView4Remote.SelectedItems[listView4Remote.SelectedItems.Count - 1];
            string       itemType     = selectedItem.SubItems[3].Text;

            if (itemType.Equals("ParentDir"))
            {
                remotePath = SFUCommon.GetParentPath4Web(remotePath);
            }
            else if (itemType.Equals("F"))
            {
                remotePath = SFUCommon.CombinePath4Web(remotePath, selectedItem.Text);
            }
            else if (itemType.Equals("N"))
            {
            }
            LoadListViewByRemotePath();
        }
예제 #5
0
 public void UploadFile(ArrayList uploadFileNameList, string localPath, string remotePath, bool isRecursive)
 {
     foreach (string fileName in uploadFileNameList)
     {
         string fileLocalPath  = Path.Combine(localPath, fileName);
         string fileRemotePath = SFUCommon.CombinePath4Web(remotePath, fileName);
         bool   isDirectory    = Directory.Exists(fileLocalPath);
         if (isDirectory)
         {
             // TODO: If the item is folder, need to traverse folder recursively(Get all file path in the folder).
         }
         else
         {
             FileStream   fileStream   = new FileStream(fileLocalPath, FileMode.Open, FileAccess.Read);
             BinaryReader binaryReader = new BinaryReader(fileStream);
             byte[]       postByte     = binaryReader.ReadBytes((int)fileStream.Length);
             upYun.writeFile(fileRemotePath, postByte, isRecursive);
         }
     }
 }