Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.Storage.Pickers;
|
||||
|
||||
namespace IPClab3.Services;
|
||||
|
||||
public class FilePickerService
|
||||
{
|
||||
public async Task<string> RequestFileOpener(IntPtr hwnd)
|
||||
{
|
||||
var picker = new FileOpenPicker();
|
||||
picker.FileTypeFilter.Add(".exe");
|
||||
|
||||
WinRT.Interop.InitializeWithWindow.Initialize(picker, hwnd);
|
||||
|
||||
var file = await picker.PickSingleFileAsync();
|
||||
return file?.Path;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user