当前位置: 首页>>代码示例>>C#>>正文


C# CloudStorageAccount.CreateCloudTableClient方法代码示例

本文整理汇总了C#中Microsoft.WindowsAzure.Storage.CloudStorageAccount.CreateCloudTableClient方法的典型用法代码示例。如果您正苦于以下问题:C# CloudStorageAccount.CreateCloudTableClient方法的具体用法?C# CloudStorageAccount.CreateCloudTableClient怎么用?C# CloudStorageAccount.CreateCloudTableClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.WindowsAzure.Storage.CloudStorageAccount的用法示例。


在下文中一共展示了CloudStorageAccount.CreateCloudTableClient方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Tracker

        public Tracker(string accountName, string keyValue)
        {
            _applicationId = IdUtil.ApplicationId();
            _deviceId = IdUtil.DeviceId();
            _anid = IdUtil.GetAnidFromOs();
            _appTitle = IdUtil.ApplicationName();
            _adsRefreshRate = 3;
            _pubCenterAdsId = new List<string>();
            _adsReady = false;

            // Due to Disallowed key in RowKey, /, \, #, ? needs to be removed
            // And excel cannot allow "=" at the beginning
            foreach (var s in _invalidRowKeyChar) {
                _deviceId = _deviceId.Replace(s, string.Empty);
                if (_deviceId.Substring(0, 1) == "=") {
                    _deviceId = "x" + _deviceId;
                }
            }

            GetAdAssemblyVersion();
            RefreshIpInfo();

            _storageCredentials = new StorageCredentials(accountName, keyValue);
            _storageAccount = new CloudStorageAccount(_storageCredentials, false);
            _tableClient = _storageAccount.CreateCloudTableClient();

            EnsureTablesCreated();
        }
开发者ID:NBitionDevelopment,项目名称:WindowsPhonePhotoHuntAnimal,代码行数:28,代码来源:Tracker.cs

示例2: AuditAzureTableProvider

 public AuditAzureTableProvider()
 {
     try
     {
         _account = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["AzureStorageConnectionString"]);
         _client = _account.CreateCloudTableClient();
     }
     catch (Exception exp)
     {
         throw new Exception("Error retreiving reference to Azure Storage Account", exp);
     }
     try
     {
         _client = _account.CreateCloudTableClient();
     }
     catch (Exception exp)
     {
         throw new Exception("Error creating Azure Table Client Object", exp);
     }
     try
     {
         _vmAuditTable = _client.GetTableReference("VMAudits");
     }
     catch (Exception exp)
     {
         throw new Exception("Error retreiving reference to Azure Table Object", exp);
     }
 }
开发者ID:smichelotti,项目名称:azureinfrastructure,代码行数:28,代码来源:AuditAzureTableProvider.cs

示例3: OnLoad

 protected override void OnLoad()
 {
     base.OnLoad();
     var accountName = RouteVariables["account"];
     var tableName = RouteVariables["table"];
     var accountInfo = (from account in StorageAccountInfo.Load() where account.AccountName == accountName select account).FirstOrDefault();
     currentStorageAccount = new CloudStorageAccount(new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(accountName, accountInfo.Key), accountInfo.UseHttps);
     table = currentStorageAccount.CreateCloudTableClient().GetTableReference(tableName);
     Grid.DataSource = new TableEntityDataSource(currentStorageAccount.CreateCloudTableClient().GetTableReference(tableName), Application);
     Grid.DataSource.DataChanged += OnDataLoad;
 }
开发者ID:adamabdelhamed,项目名称:PowerArgs,代码行数:11,代码来源:TablePage.cs

示例4: Crawler

        public Crawler()
        {
            storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
            urlQueue = storageAccount.CreateCloudQueueClient().GetQueueReference("krawlerurl");
            cmdQueue = storageAccount.CreateCloudQueueClient().GetQueueReference("krawlercmd");
            index = storageAccount.CreateCloudTableClient().GetTableReference("krawlerindex");
            errorQueue = storageAccount.CreateCloudQueueClient().GetQueueReference("krawlererror");
            lastTenUrlQueue = storageAccount.CreateCloudQueueClient().GetQueueReference("lasttenurlcrawled");
            crawlStatTable = storageAccount.CreateCloudTableClient().GetTableReference("krawlerstattable");
            disallowedPaths = new List<string>();
            visited = new HashSet<string>();

            crawlStatTable.CreateIfNotExists();
            crawlCounter = (NumberOfUrlCrawled() != 0) ? NumberOfUrlCrawled() : 0;
        }
开发者ID:ngokchau,项目名称:pa4,代码行数:15,代码来源:Crawler.cs

示例5: Log

 public async static void Log(
     string storageAccountName, 
     string storageAccountKey, 
     string exceptionsTableName, 
     string exceptionSource, 
     string exceptionDescription, 
     ILogger logger = null)
 {
     DateTime dt = DateTime.UtcNow;
     try
     {
         StorageCredentials storageCredentials = new StorageCredentials(storageAccountName, storageAccountKey);
         CloudStorageAccount storageAccount = new CloudStorageAccount(storageCredentials, true);
         CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
         tableClient.DefaultRequestOptions.RetryPolicy = new ExponentialRetry(TimeSpan.FromSeconds(1), 10);
         CloudTable table_AppExceptions = tableClient.GetTableReference(exceptionsTableName);
         await table_AppExceptions.CreateIfNotExistsAsync();
         ExceptionLog entity = new ExceptionLog((DateTime.MaxValue - dt).ToString());
         entity.DT = dt;
         entity.MachineName = Environment.MachineName;
         entity.Application = Assembly.GetEntryAssembly().GetName().Name;
         entity.Source = exceptionSource;
         entity.Description = exceptionDescription;
         await table_AppExceptions.ExecuteAsync(TableOperation.Insert(entity));
     } 
     catch (System.Exception ex)
     {
         if (logger != null)
         {
             logger.Error(exceptionSource + ":" + exceptionDescription + ": " + ex.ToString());
         }
         Console.WriteLine(dt.ToString() + " " + Environment.MachineName + ":" + Assembly.GetEntryAssembly().GetName().Name + ":" + exceptionSource + ":" + exceptionDescription + ": " + ex.ToString());
     } 
 }
开发者ID:GuardRex,项目名称:GuardRex.AzureTableStorageExceptionLogger,代码行数:34,代码来源:ExceptionLogger.cs

示例6: CreateClassRooms

        public static void CreateClassRooms(int number, int building, int floor, int capacity, string description)
        {
            StorageCredentials creds = new StorageCredentials(accountName, accountKey);
            CloudStorageAccount storageAccount = new CloudStorageAccount(creds, useHttps: true);

            // Create the table client.
            CloudTableClient classRoomClient = storageAccount.CreateCloudTableClient();

            // Create the table if it doesn't exist.
            CloudTable table = classRoomClient.GetTableReference("ClassRoom");
            table.CreateIfNotExists();

            // Create the entity.
            ClassRoomEntity foo = new ClassRoomEntity(number, building);

            foo.Floor = floor;
            foo.Capacity = capacity;
            foo.Description = description;

            // Create the TableOperation that inserts the customer entity.
            TableOperation insertOperation = TableOperation.Insert(foo);

            // Execute the insert operation.
            table.Execute(insertOperation);
        }
开发者ID:walmon,项目名称:ejemplo-fachada-sqlsat,代码行数:25,代码来源:KeyValueDA.cs

示例7: BuildUtil

 public BuildUtil(CloudStorageAccount account)
 {
     var client = account.CreateCloudTableClient();
     _buildResultDateTable = client.GetTableReference(AzureConstants.TableNames.BuildResultDate);
     _buildFailureDateTable = client.GetTableReference(AzureConstants.TableNames.BuildFailureDate);
     _viewNameDateTable = client.GetTableReference(AzureConstants.TableNames.ViewNameDate);
 }
开发者ID:jaredpar,项目名称:jenkins,代码行数:7,代码来源:BuildUtil.cs

示例8: TProduct

        public TProduct(string affiliate, string code, int qty, bool force_lookup = false)
        {
            ProductCode = code;
            Qty = qty;

            cloud = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("AbundaStorage"));

            client = cloud.CreateCloudTableClient();

            products = client.GetTableReference("Products");
            products.CreateIfNotExists();

            using (var context = new DataBaseDataContext())
            {
                var aff = (from ev in context.Affiliates
                           where ev.code == affiliate
                           select ev).FirstOrDefault();

                merchantID = aff.MerchantID;
                marketplaceID = aff.MarketPlaceID;
                secretKey = aff.SecretKey;
                accessKey = aff.AccessKey;
            }

            var amzResults = PerformAmazonLookup();
        }
开发者ID:WickedMonkeySoftware,项目名称:AbundaAzure,代码行数:26,代码来源:TProduct.cs

示例9: TableStorageJobEventContext

 public TableStorageJobEventContext(CloudStorageAccount storageAccount, string jobsTableName = "Jobs", string jobInstancesTableName = "JobInstances", string jobInstanceEventsTableName = "JobInstanceEvents")
 {
     var tableClient = storageAccount.CreateCloudTableClient();
     _jobsWriter = new TableWriter(tableClient, jobsTableName);
     _jobInstancesWriter = new TableWriter(tableClient, jobInstancesTableName);
     _jobInstanceEventsWriter = new TableWriter(tableClient, jobInstanceEventsTableName);
 }
开发者ID:CedarLogic,项目名称:RedDog.Engine,代码行数:7,代码来源:TableStorageJobEventContext.cs

示例10: SensorAccess

 public SensorAccess()
 {
     credentials = new StorageCredentials(_accountName, _key);
     storageAccount = new CloudStorageAccount(credentials, true);
     tableClient = storageAccount.CreateCloudTableClient();
     table = tableClient.GetTableReference("AccelerometerTable");
 }
开发者ID:shijiong,项目名称:FallDetection,代码行数:7,代码来源:StorageSensor.cs

示例11: Initialize

 protected override void Initialize(HttpControllerContext controllerContext)
 {
     base.Initialize(controllerContext);
     storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true");
     var tableClient = storageAccount.CreateCloudTableClient();
     table = tableClient.GetTableReference("people");
 }
开发者ID:cmpcdaly,项目名称:table-storage-web-api-cache,代码行数:7,代码来源:PersonController.cs

示例12: NDIAzureTableController

 static NDIAzureTableController()
 {
     _storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
     _tableClient = _storageAccount.CreateCloudTableClient();
     _table = _tableClient.GetTableReference("ndiparams");
     _retrieveOperation = TableOperation.Retrieve("VidParams", "LastVideo");
 }
开发者ID:JuanKRuiz,项目名称:Noches-de-Innovacion-Website,代码行数:7,代码来源:NDIAzureTableController.cs

示例13: HomeController

        public HomeController()
        {
            storageAccount = CloudStorageAccount.Parse(
            ConfigurationManager.AppSettings["StorageConnectionString"]);

            tableClient = storageAccount.CreateCloudTableClient();

            table = tableClient.GetTableReference("fouramigos");

            table.CreateIfNotExists();

            blobClient = storageAccount.CreateCloudBlobClient();

            container = blobClient.GetContainerReference("fouramigos");

            container.CreateIfNotExists();

            BlobContainerPermissions permissions = container.GetPermissions();
            permissions.PublicAccess = BlobContainerPublicAccessType.Container;
            container.SetPermissions(permissions);


            //lägga till nya
            //var tablemodels = new TableModel("Brutus", "Uggla") { Location = "T4", Description="Uggla i träd", Type="Foto" };
            //var tablemodels1 = new TableModel("brutus", "Örn") { Location = "T4", Description="Örn som flyger", Type = "Foto" };

            //var opreation = TableOperation.Insert(tablemodels);
            //var operation2 = TableOperation.Insert(tablemodels1);

            //table.Execute(opreation);
            //table.Execute(operation2);
        }
开发者ID:Quintoh,项目名称:Konstprojektet,代码行数:32,代码来源:HomeController.cs

示例14: TestDataController

 public TestDataController()
 {
     _storageAccount = ControllerUtil.CreateStorageAccount();
     _storage = new TestResultStorage(_storageAccount);
     _stats = new TestCacheStats(_storage, _storageAccount.CreateCloudTableClient());
     _statsUtil = ControllerUtil.GetOrCreateCounterStatsUtil(_storageAccount);
 }
开发者ID:jaredpar,项目名称:jenkins,代码行数:7,代码来源:TestDataController.cs

示例15: GetTable

 public async Task<CloudTable> GetTable(string tablename)
 {
     var account = new CloudStorageAccount(new StorageCredentials("slavapp", WebConfigurationManager.AppSettings["AzureStorageKey"]), true);
     var client = account.CreateCloudTableClient();
     var table = client.GetTableReference(tablename);
     await table.CreateIfNotExistsAsync();
     return table;
 }
开发者ID:sgnatonski,项目名称:slavapp,代码行数:8,代码来源:CloudTableProvider.cs


注:本文中的Microsoft.WindowsAzure.Storage.CloudStorageAccount.CreateCloudTableClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。