我试图从Azure File Storage
将文件下载到本地文件,并得到此异常:Azure CloudFile - “指定的资源名称包含无效字符。”
“为指定的资源名称包含无效字符。”
下面的代码:
if (_cloudFileShare.Exists())
{
CloudFileDirectory rootDir = _cloudFileShare.GetRootDirectoryReference();
CloudFileDirectory tempDir = rootDir.GetDirectoryReference("temp");
if (tempDir.Exists())
{
var file = tempDir.GetFileReference(saveFrom);
file.DownloadToFile(saveTo, FileMode.Open);// OFFENDING LINE
}
}
的saveTo
参数是一个字符串,值是这样的:
"C:\Users\Me\AppData\Local\Temp\tmpF2AD.tmp"
的saveFrom
的说法是这样的:
https://storageaccount.file.core.windows.net:443/fileshare/temp/tmpA2DA.tmp
我创建使用此函数的参数:
var saveTo = Path.GetTempFileName();
我在做什么错?我对Azure没有太多经验。
什么是“saveFrom”变量的值? –
@GauravMantri ...请参阅我的更新,谢谢 –