Example #1
0
        public ActionResult Index()
        {
            CloudBlobContainer container = ContainerHelper.GetContainer();
            var blobs = container.ListBlobs(useFlatBlobListing: true);

            List <BlobStorageFile> filesList = new List <BlobStorageFile>();

            foreach (IListBlobItem item in blobs)
            {
                if (item.GetType() == typeof(CloudBlockBlob))
                {
                    CloudBlockBlob blob = (CloudBlockBlob)item;
                    filesList.Add(new BlobStorageFile
                    {
                        Name = blob.Name, Size = blob.Properties.Length / 1024, Uri = blob.Uri
                    }
                                  );
                }
            }

            return(View(filesList));
        }
Example #2
0
 //入队
 public static void WriteQueue(Timer timer)
 {
     LogHelper.WriteInfo("当前入队时间:" + DateTime.Now.ToString("yyyyMMdd hh:mm:ss"));
     timer.Stop();
     try
     {
         //查询任务表
         var container = ContainerHelper.GetContainer();
         var manager   = container.Resolve <IKiaserTaskBLL>();//通过resolve方法取得对象
         var kiasers   = manager.GetKiaserTasks();
         foreach (var item in kiasers)
         {
             PrduQueue.Enqueue(item);
             manager.Delete(item.ID);
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteError(ex.Message);
     }
     timer.Start();
 }