예제 #1
0
        private void makeNewFolderLocal()
        {
            try
            {

                NewFolder nf = new NewFolder(true);
                if (nf.ShowDialog() == DialogResult.OK)
                {
                    if (nf.NewFolderName.Length > 1)
                    {

                       string current_path = tbLocalPath.Text;
                        string path = current_path+"\\" + nf.NewFolderName; 

                       if (!Directory.Exists(path))
                       {
                           Directory.CreateDirectory(path);
                           addToStatusLog("Created new folder on local");
                           RefreshLocal(current_path);
                       }

                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "NFS Client - Error");
            }
        }
예제 #2
0
        private void btnNewFolder_Click(object sender, EventArgs e)
        {
            try
            {
                if (nfsClient == null)
                    return;

                NewFolder nf = new NewFolder();
                if (nf.ShowDialog() == DialogResult.OK)
                {
                    byte UserP, GroupP, OtherP;

                    switch(nf.userPSelectedIndex)
                    {
                        case 0: UserP = 4; break;
                        case 1: UserP = 6; break;
                        case 2: UserP = 7; break;
                        default: UserP = 7; break;
                    }

                    switch(nf.groupPSelectedIndex)
                    {
                        case 0: GroupP = 4; break;
                        case 1: GroupP = 6; break;
                        case 2: GroupP = 7; break;
                        default: GroupP = 7; break;
                    }

                    switch(nf.otherPSelectedIndex)
                    {
                        case 0: OtherP = 4; break;
                        case 1: OtherP = 6; break;
                        case 2: OtherP = 7; break;
                        default: OtherP = 7; break;
                    }

                    nfsClient.CreateDirectory( 
                        nfsClient.Combine(nf.NewFolderName, RemoteFolder),
                        new NFSLibrary.Protocols.Commons.NFSPermission(UserP, GroupP, OtherP));
                    RefreshRemote();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "NFS Client");
            }
        }
예제 #3
0
        private void makeNewFolderRemote()
        {
            try{
               if (nfsClient == null)
                  return;

                  NewFolder nf = new NewFolder(false);
                if (nf.ShowDialog() == DialogResult.OK)
                  {
                      if (nf.NewFolderName.Length > 1)
                      {
                          nfsClient.CreateDirectory(
                              nfsClient.Combine(nf.NewFolderName, RemoteFolder),
                              new NFSLibrary.Protocols.Commons.NFSPermission(nf.userPermisions,nf.groupPermisions,nf.otherPermisions));
                          addToStatusLog("Created new folder on remote");
                          tryToRefreshRemote();
                      }
                  }
              }
              catch (Exception ex)
              {
                  MessageBox.Show(ex.Message, "NFS Client - Error");
              }
        }