Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using (FileStream fs = File.Open(@"C:UsersPublicDocumentscombined.json", FileMode.CreateNew))
- {
- using (StreamWriter sw = new StreamWriter(fs))
- {
- using (JsonWriter jw = new JsonTextWriter(sw))
- {
- jw.Formatting = Formatting.None;
- JArray list = new JArray();
- JsonSerializer serializer = new JsonSerializer();
- jw.WriteStartArray();
- foreach (IListBlobItem blob in blobContainer.ListBlobs(prefix: "SharePointBlobs/"))
- {
- if (blob.GetType() == typeof(CloudBlockBlob))
- {
- var blockBlob = (CloudBlockBlob)blob;
- var content = blockBlob.DownloadText();
- var deserialized = JArray.Parse(content);
- //deserialized = JsonConvert.DeserializeObject(content);
- list.Merge(deserialized);
- serializer.Serialize(jw, list);
- }
- else
- {
- Console.WriteLine("Non-Block-Blob: " + blob.StorageUri);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement