Step 1: Create storage.
Step 2: Create Container. Set to Public Container.
Upload the Images using Azure Storage Explorer tool or app.
Step 3: Start Visual Studio Create Windows 8 New XAML/ C# App.
Right click on “References” & select “Manage NuGet Packages…”
Enter the term for search “Windows Azure Storage”.
Step 4: After installation Windows Azure Storage Package or DLL added to the App.
Step 5: Open MainPage.xaml file.
- <Grid Background="{StaticResourceApplicationPageBackgroundThemeBrush}">
- <ListBox x:Name="myListBox">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="{Binding}" Height="200" Width="1000" />
- <Image Source="{Binding}" Height="100" Width="100" />
- </StackPanel>
- </DataTemplate>
- </ListBox.ItemTemplate>
-
- </ListBox>
- </Grid>
Step 6: Open MainPage.xaml.cs file.
Add few references
- usingMicrosoft.WindowsAzure.Storage;
- usingMicrosoft.WindowsAzure.Storage.Auth;
- usingMicrosoft.WindowsAzure.Storage.Blob;
- usingSystem.Diagnostics;
- protectedasyncoverridevoidOnNavigatedTo(NavigationEventArgs e)
- {
- var credentials = newStorageCredentials("fortestingnew", "96OdFITud72q8RTfhsJeM1i1Yov8Qlrk9sXLBKOjh7FtOsxYV3klrScv7AE53R8keH9Ylj8JTbBSf177wBDjIw==");
- var account = newCloudStorageAccount(credentials, true);
- varblobClient = account.CreateCloudBlobClient();
- var container = blobClient.GetContainerReference("myowncontainer");
- awaitcontainer.CreateIfNotExistsAsync();
- BlobContinuationToken x = newBlobContinuationToken();
- BlobResultSegment result = awaitcontainer.ListBlobsSegmentedAsync(x);
- List < string > dataSet = newList < string > ();
- foreach(var item inresult.Results)
- {
- dataSet.Add(item.Uri.AbsoluteUri);
-
- }
- myListBox.ItemsSource = dataSet;
-
- }
Now run the App.
Retrieving the url & image.