当我尝试迭代ListBlobs()调用的结果时,我得到"指定的资源不存在"异常.我直接访问它时可以获取blob属性,但我正在尝试获取子目录中所有blob的列表.
我写了这个小测试来确切地看到问题所在.我有一个测试驱动程序和两个方法.第一个方法"GetBlockBlobDateTime"运行正常并返回现有blob的日期时间.第二种方法"GetBlobDirFiles"使用相同的输入,并在我尝试迭代blobItems时抛出excpetion.
foreach (IListBlobItem blobItem in blobItems)
Run Code Online (Sandbox Code Playgroud)
请注意,两种方法都使用相同的数据.我错过了什么?
public static void DoTest(string baseURL, string container, string directory, string fileName)
{
DateTime t = GetBlockBlobDateTime( baseURL, container, directory, fileName);
List<string> fileList = GetBlobDirFiles( baseURL, container, directory);
}
public static DateTime GetBlockBlobDateTime(string baseURL, string container, string directory, string fileName)
{
CloudBlobClient blobClient = new CloudBlobClient(baseURL);
CloudBlobDirectory blobDir = blobClient.GetBlobDirectoryReference(container);
CloudBlobDirectory subDirectory = blobDir.GetSubdirectory(directory);
CloudBlockBlob cloudBlockBlob = subDirectory.GetBlockBlobReference(fileName);
cloudBlockBlob.FetchAttributes();
DateTime cloudTimeStampUTC = cloudBlockBlob.Properties.LastModifiedUtc;
return cloudTimeStampUTC;
}
public static List<string> GetBlobDirFiles(string baseURL, string container, …Run Code Online (Sandbox Code Playgroud) 我的问题是我可以在一个语句中完成这两个选项的功能并摆脱IF吗?
DECLARE @recID INT;
--Case 1
SET @recID = null;
--Case 2
--SET @recID = 117;
IF @recID is null
BEGIN
select * from myTable WHERE [myIDcolumn] is null -- works when recID is null
END
ELSE
BEGIN
select * from myTable WHERE [myIDcolumn] = @recID -- works when recID is number
END
Run Code Online (Sandbox Code Playgroud) 我想删除第一行:
!string.IsNullOrEmpty(cell.Text)
Run Code Online (Sandbox Code Playgroud)
这会引起任何问题吗?
我在一些代码中遇到了这个:
if ((id % 2 == 0)
&& !string.IsNullOrEmpty(cell.Text)
&& !string.IsNullOrEmpty(cell.Text.Trim())
)
Run Code Online (Sandbox Code Playgroud)
我认为第一个string.IsNullOrEmpty会在带空格的字符串上返回false,
而Trim()的行会处理它,所以第一个IsNullOrEmpty是无用的
但是在我删除没有修剪的线之前我以为我会被小组运行它.
我有一个依赖于 Azure SDK 1.8 版和 Azure 表和 blob 存储的应用程序。Azure SDK 1.8 计划于 2015 年 11 月 12 日“退休”。
我认为 SDK 会继续工作,而且退役的存储服务版本太旧了,不会影响我,但我想确定。
Azure SDK 版本停用日期为https://msdn.microsoft.com/en-us/library/azure/dn479282.aspx
Version: 1.8/October 2012
Release Date: October 2012
Retirement Date: November 12 2015
Run Code Online (Sandbox Code Playgroud)
Microsoft Azure 存储服务版本删除版本日期为http://blogs.msdn.com/b/windowsazurestorage/archive/2015/10/19/microsoft-azure-storage-service-version-removal-update-extension-to-2016 .aspx
Version 2009-07-17 and prior Azure storage versions will be …Run Code Online (Sandbox Code Playgroud) 我有一个通用的问题和具体的例子.根据Stack Overflow关于名称空间程序集的所有类似问题,这应该很容易.最常见的答案是问题我如何知道要包含哪些引用来导入特定的.NET命名空间?.
"所有MSDN文档页面都提到命名空间和汇编."
但是在这个MSDN页面上没有提到程序集.我错过了什么明显的事情?
Microsoft.WindowsAzure.ServiceRuntime命名空间
修订:
更具体地说,我正在寻找包含Azure类RoleEnvironment的DLL文件.当我点击F1并查看其MSDN页面MSDN RoleEnvironment时,它提到了Microsoft.WindowsAzure.ServiceRuntime命名空间,但没有要包含的程序集.我之前遇到过这样的事情,所以我想我会把它变成一个普通的问题.虽然我想知道要引用的特定DLL文件,但我也想知道答案,所以我知道下次遇到这种情况时该怎么做.
我想将一些开源C编译成一个x64 dll用于azure.
我有Visual Studio Professional,但只有C#和F#出现在项目模板中,没有C++.
如何显示C或C++项目模板?
我究竟做错了什么?
我正在尝试从示例MVC应用程序登录到Azure Active Directory,并收到“错误请求”。
我在这里查看示例(日期为2015年7月17日):
以下是其他人对相同数据的详细说明:
我将活动目录的名称替换为下面的“ myActiveDirectory”。
这是我的webconfig数据:
<add key="ida:AppKey" value="<snip my key>" />
<add key="ida:ClientId" value="d2bfc007-<snip my client ID>-9f" />
<add key="ida:Tenant" value="myActiveDirectory.onmicrosoft.com" />
<add key="ida:AADInstance" value="https://login.windows.net/{0}" />
<add key="ida:PostLogoutRedirectUri" value="https://localhost:44320/" />
Run Code Online (Sandbox Code Playgroud)
AccountController.cs
using System.Web;
using System.Web.Mvc;
// OWIN
using Microsoft.Owin.Security;
using Microsoft.Owin.Security.OpenIdConnect;
using Microsoft.Owin.Security.Cookies;
namespace TodoListWebApp.Controllers
{
public class AccountController : Controller
{
public void SignIn()
{
// Sends an OpenID sign-in request.
if (!Request.IsAuthenticated)
{
HttpContext.GetOwinContext().
Authentication.Challenge(new AuthenticationProperties { RedirectUri = "/" },
OpenIdConnectAuthenticationDefaults.AuthenticationType); …Run Code Online (Sandbox Code Playgroud) Question: What am I missing to access azure development table storage?
Note: I can access my azure CLOUD storage (using different code of course), but I am failing when trying to access the development storage.
I'm using:
Microsoft Azure Storage Emulator v4.0 <- changing to v4.2 fixed issue
var cloudStorageAccount = CloudStorageAccount.DevelopmentStorageAccount;
var tableClient = cloudStorageAccount.CreateCloudTableClient(); …Run Code Online (Sandbox Code Playgroud)