添加上传
parent
f5a1cb731e
commit
332932938c
|
|
@ -23,7 +23,7 @@
|
|||
StartValue="1000" />
|
||||
</h:Interaction.Behaviors>
|
||||
|
||||
<Button h:Cattach.Icon="" Content="上传" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
||||
<Button h:Cattach.Icon="" Command="{Binding UploadCommand}" Content="上传" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
||||
<Button h:Cattach.Icon="" Content="下载" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
||||
<Button h:Cattach.Icon="" Content="分享" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
||||
<Button h:Cattach.Icon="" Content="删除" Style="{DynamicResource {x:Static h:ButtonKeys.Dynamic}}" />
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ namespace HeBianGu.App.Disk
|
|||
public ExplorerControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new LoyoutViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
using HeBianGu.Base.WpfBase;
|
||||
using HeBianGu.Service.Mvc;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace HeBianGu.App.Disk
|
||||
|
|
@ -83,6 +85,50 @@ namespace HeBianGu.App.Disk
|
|||
|
||||
}
|
||||
|
||||
#region 文件上传
|
||||
private ICommand _uploadCommand;
|
||||
public ICommand UploadCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return _uploadCommand ?? (_uploadCommand = new RelayCommand(UploadFile));
|
||||
}
|
||||
}
|
||||
|
||||
private void UploadFile(object obj)
|
||||
{
|
||||
//// 打开文件选择对话框
|
||||
//OpenFileDialog openFileDialog = new OpenFileDialog();
|
||||
//openFileDialog.Filter = "All Files (*.*)|*.*"; // 设置文件过滤器
|
||||
//openFileDialog.Multiselect = false; // 单文件上传
|
||||
|
||||
//if (openFileDialog.ShowDialog() == true)
|
||||
//{
|
||||
// string filePath = openFileDialog.FileName;
|
||||
// string fileName = Path.GetFileName(filePath);
|
||||
|
||||
// try
|
||||
// {
|
||||
// // 模拟文件上传逻辑
|
||||
// // 这里可以替换为实际的上传逻辑,例如调用 API 或保存到指定目录
|
||||
// string destinationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), fileName);
|
||||
// File.Copy(filePath, destinationPath, overwrite: true);
|
||||
|
||||
// // 更新上传时间
|
||||
// UploadTime = DateTime.Now;
|
||||
|
||||
// // 提示上传成功
|
||||
// MessageBox.Show($"文件 {fileName} 上传成功!", "上传完成", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// // 处理上传失败
|
||||
// MessageBox.Show($"文件上传失败: {ex.Message}", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
internal class DataFileViewModel : ObservableSourceViewModel<TestViewModel>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,4 @@
|
|||
{
|
||||
"sdk": {
|
||||
"version": "8.0.407"
|
||||
},
|
||||
"Minio": {
|
||||
"Endpoint": "192.168.10.141:9000",
|
||||
"AccessKey": "kr4Lr0v01uXVDP08PDUn",
|
||||
|
|
|
|||
Loading…
Reference in New Issue