コード例 #1
0
    private void Fill_List(int Rows)
    {
        string Imagespath = HttpContext.Current.Server.MapPath("~/Images/");
        string SitePath   = HttpContext.Current.Server.MapPath("~");
        var    Files      = (from file in Directory.GetFiles(Imagespath) select new { image = file.Replace(SitePath, "~") }).Take(Rows);

        ImageGrid.DataSource = Files.ToList();
        ImageGrid.DataBind();
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            CloudStorageAccount sa     = CloudStorageAccount.Parse(Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetConfigurationSettingValue("mycon"));
            CloudBlobClient     client = sa.CreateCloudBlobClient();

            container = client.GetContainerReference("photobucket");
            container.CreateIfNotExists();
            container.SetPermissions(new BlobContainerPermissions {
                PublicAccess = BlobContainerPublicAccessType.Blob
            });
            ImageGrid.DataSource = container.ListBlobs();
            ImageGrid.DataBind();
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CloudStorageAccount sa     = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("SACS"));
            CloudBlobClient     client = sa.CreateCloudBlobClient();

            container = client.GetContainerReference("photobucket");
            container.CreateIfNotExists();
            container.SetPermissions(new BlobContainerPermissions {
                PublicAccess = BlobContainerPublicAccessType.Blob
            });
            ImageGrid.DataSource = container.ListBlobs();
            ImageGrid.DataBind();
        }