22 lines
526 B
C#
22 lines
526 B
C#
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;
|
|
}
|
|
} |