是否有人曾經設法使用Windows 8應用程序將文件從unc目錄複製到本地目錄?Windows 8 StorageFile.GetFileFromPathAsync使用UNC路徑
According to the official documentation here
它可以連接到一個UNC路徑
我使用STD文件訪問樣本,並已改變了一行代碼讀取如下 我添加了所有功能 加.txt作爲文件類型 UNC路徑被讀取寫入所有人,並位於同一臺機器上。
但是我不斷收到訪問被拒絕錯誤。
任何人都可能提供給我一個工作示例 這讓我很生氣,真正質疑win 8開發的整個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;
}
}
事實上,我認爲這是唯一的辦法。 – 2013-03-03 22:46:37