0
我要上传.TXT的列表,并将其保存在自定义文件夹在SkyDrive上上传到特定文件夹的SkyDrive
喜欢一个人的账户 - > SkyDrive中 - >自定义文件夹(“testfile将”)
我试图
LiveOperationResult res = await client.BackgroundUploadAsync("me/skydrive/testfile", new Uri("/shared/transfers/" + t, UriKind.Relative),OverwriteOption.Overwrite);
,
但它不会在所有的工作,它给我的错误:
URL中包含路径“testfi le',这是不支持的。
如果我需要获取文件夹ID来上传文件,我如何获得ID?
这里是我的代码:
private async void button_Click(object sender, EventArgs e)
{
IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
var temptempout = new List<String>(isoStore.GetFileNames("*").ToList());
int total = temptempout.Count;
int now = 0;
if (temptempout.Count > 0)
{
ShowTextDebug.Text = "Uploaded 0 of " + total + " files";
foreach (String t in temptempout)
{
using (var fileStream = isoStore.OpenFile(t, FileMode.Open, FileAccess.Read))
{
try
{
LiveOperationResult res = await client.BackgroundUploadAsync("me/skydrive/testfile",
new Uri("/shared/transfers/" + t, UriKind.Relative),
OverwriteOption.Overwrite
);
}
catch (Exception err)
{
String rrtt = "there is an error while uploading txt " + err.Message;
MessageBox.Show(rrtt, "error", MessageBoxButton.OK);
}
}
now++;
ShowTextDebug.Text = "Uploaded " + now + " of " + total + " files";
}
ShowTextDebug.Text += "\nupload complete";
}
else
{
MessageBox.Show("no txt exist", "error", MessageBoxButton.OK);
}
}
感谢帮助我