Beispiel #1
0
        private async Task CreateFolderAsync()
        {
            await ftpSemaphore.WaitAsync();

            try
            {
                DialogContentWithTextBox content = new DialogContentWithTextBox();
                content.ContentText = "新文件夹名称:";
                ContentDialog dialog = new ContentDialog()
                {
                    Content           = content,
                    PrimaryButtonText = "确定",
                    CloseButtonText   = "取消"
                };

                if (await dialog.ShowAsync() == ContentDialogResult.Primary)
                {
                    progressBar.IsIndeterminate = true;
                    progressBar.Visibility      = Visibility.Visible;

                    var currentPath = currentAddress.LocalPath + currentAddress.Fragment;
                    await client.SetWorkingDirectoryAsync(currentPath);

                    await client.CreateDirectoryAsync(content.TextBoxText);
                }
            }
            finally
            {
                progressBar.Visibility = Visibility.Collapsed;
                ftpSemaphore.Release();
            }
        }