本文整理汇总了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();
}
示例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);
}
}
示例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;
}
示例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;
}
示例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());
}
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例10: SensorAccess
public SensorAccess()
{
credentials = new StorageCredentials(_accountName, _key);
storageAccount = new CloudStorageAccount(credentials, true);
tableClient = storageAccount.CreateCloudTableClient();
table = tableClient.GetTableReference("AccelerometerTable");
}
示例11: Initialize
protected override void Initialize(HttpControllerContext controllerContext)
{
base.Initialize(controllerContext);
storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true");
var tableClient = storageAccount.CreateCloudTableClient();
table = tableClient.GetTableReference("people");
}
示例12: NDIAzureTableController
static NDIAzureTableController()
{
_storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
_tableClient = _storageAccount.CreateCloudTableClient();
_table = _tableClient.GetTableReference("ndiparams");
_retrieveOperation = TableOperation.Retrieve("VidParams", "LastVideo");
}
示例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);
}
示例14: TestDataController
public TestDataController()
{
_storageAccount = ControllerUtil.CreateStorageAccount();
_storage = new TestResultStorage(_storageAccount);
_stats = new TestCacheStats(_storage, _storageAccount.CreateCloudTableClient());
_statsUtil = ControllerUtil.GetOrCreateCounterStatsUtil(_storageAccount);
}
示例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;
}