2013-03-27 36 views
2

我的代码:无法解析CloudStorageAccount

CloudStorageAccount.TryParse("DefaultEndpointsProtocol=http;AccountName=your_storage_account_name;AccountKey=your_storage_account_key"); 

始终返回false。我只能将它用于连接字符串“UseDevelopmentStorage = true”。出于测试目的,我需要用另一个(虚拟)连接字符串运行它,但我无法解析它。请指教。

抛出的异常是“的账户信息没有有效的组合找到”

+0

你在开发或生产尝试? 你有没有试过DefaultEndpointsProtocol = https? 你确定你的数据帐户是正确的吗? – lorddarkangel 2013-07-22 15:26:10

+0

为什么不将连接字符串存储在ServiceConfiguration文件中? – lorddarkangel 2013-07-22 15:38:57

回答

0

您需要使用一个账号密码与有效的大小和格式。 尝试使用此:kiRN0h4jm24fyLZIT7y5 + iA8nLE + 5QUPisiFNJ/9bH4ws6T/m9sHmr22/dw0i + 31Dgb/9JxYjj/V8SHxVPp7IA ==

0

试试这个:(使用HTTPS)

Dim account As CloudStorageAccount 

    If CloudStorageAccount.TryParse("AccountName=youraccount;AccountKey=YourAccountKey;DefaultEndpointsProtocol=https", account) Then 
     Dim tableClient As CloudTableClient = account.CreateCloudTableClient() 
     Dim table As CloudTable = tableClient.GetTableReference("Test") 
     table.CreateIfNotExists() 
    End If