我正在读取/写入 blob 存储中的文件,并且遇到了 AcquireLeaseAsync 和 BreakLeaseAsync 的问题。我认为这就是我调用 AcquireLeaseAsync 的方式,但不知道为什么。
这是我的代码
CloudBlockBlob blob = // get reference to blob
// I want to acquire a lease on the blob until I am done,
//the parameter null in this case means infinite until breaking
string leaseResult = await blob.AcquireLeaseAsync(null, Guid.NewGuid().ToString());
// get content
string previousContent = await blob.DownloadTextAsync();
// do other stuff
// write new content, **but exception is thrown here**
await blob.UploadTextAsync("new content");
// break a lease on the blob as …Run Code Online (Sandbox Code Playgroud) 我在运行我在Nexus 7上的Android Studio中开发的应用程序时遇到了问题.在使用相同的平板电脑和计算机(运行Windows 8)之前,我已经成功地使用了这个应用程序,但是因为我的笔记本电脑已修复并且所有内容都已擦除我是说服我的开发环境的东西搞砸了.
当我去运行项目时,没有可用的设备,因此它不再识别我的Nexus 7.
我尝试过的事情
任何帮助将不胜感激.这非常令人沮丧,我想再次回到开发阶段.
更新 - 我刚刚注意到,当我转到开发人员选项时,"等待调试器"(在您调整USB调试的位置附近)显示为灰色.我认为这与它有关,但我不确定如何启用它.
我试图哈希string到一个pointer to a void function which takes in a string.尝试将键值对插入映射时出现以下错误:
"没有匹配的成员函数来调用"插入"
我不知道如何解释这个错误.
我想我要么输入错误的类型进行插入,函数引用不正确,要么输入错误的函数指针.
#include <string>
#include <unordered_map>
using namespace std;
void some_function(string arg)
{
//some code
}
int main(int argc, const char * argv[]) {
typedef void (*SwitchFunction)(string);
unordered_map<string, SwitchFunction> switch_map;
//trouble with this line
switch_map.insert("example arg", &some_function);
}
Run Code Online (Sandbox Code Playgroud)
任何意见,将不胜感激.
我创建了一个机器人应用程序,我已经成功地通过模拟器在本地进行了测试。
在https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html之后,我将机器人应用程序发布到 Azure。(创建为http://mybotappname.azurewebsites.net)
然后,我转到https://dev.botframework.com上的 Microsoft Bot Framework 门户并注册了机器人,并确保将消息传递端点设置为
http s ://mybotappname.azurewebsites.net /api/messages
成功注册后,我更新了 web.config 中的 MicrosoftAppId 和 MicrosoftAppPassword 密钥。
但是,当我尝试“测试与您的机器人的连接”时,我看到的只是一条消息
“未经授权”
我如何调试这是从哪里来的?
我尝试运行 Bot Framework Channel Emulator,将 Bot Url 设置为与我的 Bot 为 Messaging 端点设置的 URL 相同的 URL。这也给了我一条“401 Unauthorized”消息,但我不知道如何/在哪里调试原因。
有没有人经历过这个或知道我可以做些什么来调试?
谢谢