OneDrive core concepts (पहले SkyDrive) करने के लिए आप फ़ाइलों को सूचीबद्ध करने के लिए दो विकल्प हैं अनुसार, या तो शीर्ष निर्देशिका या किसी विशिष्ट फ़ोल्डर में। आप को पता चला के रूप में, आप शीर्ष फ़ाइलों GetCompleted
घटना में उपयोग करते हुए
liveClient.GetAsync("me/skydrive/files");
और आप folderId + "/files"
का उपयोग किसी विशिष्ट फ़ोल्डर के लिए, उदाहरण के
liveClient.GetAsync(folder.Id + "/files");
के लिए सूचीबद्ध कर सकते हैं आप डेटा कुंजी से सभी फाइलों को सूचीबद्ध कर सकते हैं
private void onFilesInformationDownloaded(object sender,
LiveOperationCompletedEventArgs e) {
if (e.Result == null) {
// check e.Error for reason why it failed
return;
}
List<object> data = (List<object>)e.Result["data"];
foreach (IDictionary<string, object> content in data) {
string type = (string)content["type"];
if (type == "folder") {
// do something with folders?
}
string filename = (string)content["name"];
string fileId = (string)content["id"];
// use fileId to download a file or list files in a folder
// there's a few more details available in content.Keys
// such as created_time and updated_time for those interested
}
}
काम नहीं करता: मैं e.Result के लिए एक KeyNotFoundException मिल [ "डाटा"] – Calanus
हाँ, मैं यह जड़ SkyDrive फ़ोल्डर यानी मुझ में फ़ाइलों को सूचीबद्ध करने के लिए पूछ रहा हूँ/skydrive – Calanus
क्या आप अपने शब्दकोश के माध्यम से पुनरावृत्त कर सकते हैं, और इसमें मौजूद कुंजियां देख सकते हैं। – MBen