我需要能够提取完整的文件名,包括用户使用我的 InputFile 元素选择文件时的路径。
所以,作为一个例子,使用这个
<InputFile OnChange="FileSelected" />
我可以像这样在事件处理程序中看到文件名
void FileSelected(InputFileChangeEventArgs eventArgs)
{
//eventArgs.File.Name has just the name of the file, e.g. ABC.csv but I need the full path like c:\userfolder\ABC.csv
但是经过各种谷歌搜索尝试,我无法弄清楚如何获取完整的文件名。
这里的目的是向用户展示一个文件对话框,他们可以在其中选择一个文件,然后我可以使用完整文件路径加载一些其他需要的文件。
谢谢