【发布时间】:2013-03-03 20:14:59
【问题描述】:
有没有人设法使用 Windows 8 应用程序将文件从 unc 目录复制到本地目录?
According to the official documentation here
可以连接到 UNC 路径
我正在使用 std FILE ACCESS 示例,并将一行代码更改为如下所示 我添加了所有功能 添加 .txt 作为文件类型 UNC 路径对每个人都是读写的,并且位于同一台机器上。..
但我不断收到拒绝访问错误。
谁能给我一个可行的例子 这让我发疯,并且真的质疑 Win 8 dev 的 LOB 应用程序的全部意义。
TIA
private async void Initialize()
{
try
{
//sampleFile = await Windows.Storage.KnownFolders.DocumentsLibrary.GetFileAsync(filename);
string myfile = @"\\ALL387\Temp\testfile.txt";
sampleFile = await Windows.Storage.StorageFile.GetFileFromPathAsync(myfile);
}
catch (FileNotFoundException)
{
// sample file doesn't exist so scenario one must be run
}
catch (Exception e)
{
var fred = e.Message;
}
}
【问题讨论】: