小编axb*_*eit的帖子

使用 Azure Bot Framework 网络聊天无法点击电话号码

设置

我使用QnAMakerAzure Bot Service和JavaScript 中的Bot Framework Web Chat客户端创建了一个 Azure QnA Web Chat Bot 。

这是我如何使用 HTML + JS 初始化机器人的示例:

<script src="https://cdn.botframework.com/botframework-webchat/4.6.0/webchat-es5.js"></script>

<div id="projekt-webchat" role="main"></div>
Run Code Online (Sandbox Code Playgroud)
window.WebChat.renderWebChat(
    {
       directLine: window.WebChat.createDirectLine({
          secret: 'SECRETHERE'
       }),
       userID: 'YOUR_USER_ID',
       username: 'Web Chat User',
       locale: 'en-US',
       botAvatarInitials: 'WC',
       userAvatarInitials: 'WW'
    },
    document.getElementById('projekt-webchat')
);
Run Code Online (Sandbox Code Playgroud)

我的机器人连接到来自 QnA Maker 的知识库,其中有一个QnA 对,如下所示:

问题gimmenumber
答案+49 5251 123456

本机浏览器检测

某些浏览器会将其呈现为可点击的超链接,然后我选择拨打该号码。但是,其他浏览器没有将电话号码视为超链接,所以我无法点击它

  • 有效- Microsoft Edge 41
  • 作品- Microsoft EdgeHTML 16
  • 损坏 …

html azure tel azure-bot-service azure-qna-maker

5
推荐指数
1
解决办法
337
查看次数

为什么这个'标签'是一个领域?

我目前通过Xamarin书自己工作.在那里你可以看到这个代码:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using Xamarin.Forms;

namespace BookCode

{
    public class Greetings : ContentPage
{
    public Greetings()
    {
        Label label;

        label = new Label
        {
            FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)),
            HorizontalOptions = LayoutOptions.Center,
            VerticalOptions = LayoutOptions.Center
            };

        Content = label;

           SizeChanged += OnPageSizeChanged;


        void OnPageSizeChanged(object sender, EventArgs args)
        {
            label.Text = String.Format("{0} \u00D7 {1}", Width, Height);
        }
    }
}
}
Run Code Online (Sandbox Code Playgroud)

在代码的解释中,您可以阅读:

"相反,事件处理程序访问Label元素(方便地保存为字段)以显示页面的Width和Height属性.Btring.Format调用中的Unicode字符是一个时间(×)符号."

我目前对领域和属性的了解基本上是这样的:

public class ClassName
{
private string field;

public string property {get …
Run Code Online (Sandbox Code Playgroud)

c# field properties xamarin xamarin.forms

3
推荐指数
1
解决办法
87
查看次数

Function not working if src is a variable?

With this HTML the function myFunc() can be executed. https://myurl.de/myjs.js has the function myFunc in it.

<head>
 <script type="text/javascript" src="https://myurl.de/myjs.js"></script>
 <body>
  <script type="text/javascript">
   myFunc();
  </script>
 </body>
</head>
Run Code Online (Sandbox Code Playgroud)

But with the second HTML I get an Error: Uncaught ReferenceError: myFunc is not defined.

https://myurl.de/settingsFile.js is a file that includes this url in a var: https://myurl.de/myjs.js so basically SettingsFile.UrlToMyJS is this https://myurl.de/myjs.js

<head>
 <script src="https://myurl.de/settingsFile.js"></script>
 <script type="text/javascript" id="myid"></script>
</head>
 <body>
  <script type="text/javascript">
   document.getElementById('myid').src = SettingsFile.UrlToMyJS;
   myFunc();
  </script>
 </body>
Run Code Online (Sandbox Code Playgroud)

When I …

html javascript

2
推荐指数
1
解决办法
63
查看次数

工具栏项目未显示

我目前正在阅读这本书

在本书的开头我就遇到了一个问题。我有PrimaryToolbarItems 和SecondaryToolbarItems。但它们都没有显示。我究竟做错了什么?

<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
             xmlns:local="clr-namespace:BookCode" 
             x:Class="BookCode.MainPage"
             Title="Visuals">


    <StackLayout Padding="10,0">
        <Label Text="Hello, Xamarin.Forms!"
               FontSize="Large"
               VerticalOptions="CenterAndExpand"
               HorizontalOptions="Center"/>

        <Button Text="Click Me!"
                VerticalOptions="CenterAndExpand"
                HorizontalOptions="Center"/>

        <Switch VerticalOptions="CenterAndExpand"
                HorizontalOptions="Center"/>
    </StackLayout>

    <ContentPage.ToolbarItems>
        <ToolbarItem Text="edit" Order="Primary">
            <ToolbarItem.Icon>
                <OnPlatform x:TypeArguments="FileImageSource"
                            iOS="edit.png"
                            Android="ic_action_edit.png"
                            WinPhone="Images/edit.png"/>

            </ToolbarItem.Icon>
        </ToolbarItem>
        <ToolbarItem Text="search" Order="Primary">
            <ToolbarItem.Icon>
                <OnPlatform x:TypeArguments="FileImageSource"
                            iOS="search.png"
                            Android="ic_action_search.png"
                            WinPhone="Images/feature.search.png"/>
            </ToolbarItem.Icon>
        </ToolbarItem>

        <ToolbarItem Text="refresh" Order="Primary">
            <ToolbarItem.Icon>
                <OnPlatform x:TypeArguments="FileImageSource"
                            iOS="reload.png"
                            Android="ic_action_refresh.png"
                            WinPhone="Images/refresh.png"/>
            </ToolbarItem.Icon>
        </ToolbarItem>

        <ToolbarItem Text="explore" Order="Secondary"/>
        <ToolbarItem Text="discover" Order="Secondary"/>
        <ToolbarItem Text="evolve" Order="Secondary" />
    </ContentPage.ToolbarItems> …
Run Code Online (Sandbox Code Playgroud)

xaml toolbar toolbaritems xamarin xamarin.forms

1
推荐指数
1
解决办法
5507
查看次数

如何在Visual Studio中搜索注释?(VS 2015)

是否可以在搜索中包含评论?或者甚至可以排除代码并仅搜索评论?

比如说

int a = 1;
//int b = 2;
Run Code Online (Sandbox Code Playgroud)

如果我搜索,int我只会找到int未评论的内容.我想找到评论的那个.

编辑

我注意到的另一件事.当我在xaml中搜索内容时,我也找不到它们.例:

<TextBlock x:Name="veryImportant"/>
Run Code Online (Sandbox Code Playgroud)

通过搜索例如TextBlockName或找不到 veryImportant

有可能以某种方式找到它吗?

c# visual-studio visual-studio-2015 uwp

0
推荐指数
1
解决办法
296
查看次数

更改文件的修改日期?

在我的本地文件夹中,我有一个文件sample.txt

右键单击 -> 属性 -> 详细信息

我可以看到它的修改日期。例如 2018 年 10 月 30 日 09:00。

我可以通过 UWP 更改此属性吗?以2018年10月20日 09:00 为例。

c# file uwp

0
推荐指数
1
解决办法
731
查看次数

我可以等待字符串更改吗?

我有一个带有PDFReader的UWP应用。PDFReader有一个搜索窗口。在搜索文本框中输入单词后,便可以开始搜索。当前,这样一来,如果您开始搜索,则必须等待3秒钟,直到看到一条消息,该单词的出现频率很高。

现在,我想用“正在搜索...”消息填充这3秒钟。

我有一个解决方案是:

private async void DoSearch(...)
{
//...
Task<string> searchingText = setSearchMsg();
infoBox.Text = await searchingText;
//...
}

private async Task<string> setSearchMsg()
{
infoBox.Text = "Searching...";
await Task.Delay(1);
return "";
}
Run Code Online (Sandbox Code Playgroud)

但这看起来并不正确。我注意到的一件事是,当我正在寻找一个单词并且可以在80页中找到3000次该单词时,infoBox跳过“正在搜索...”消息,并再次将信息框填充为空。为了解决这个问题,我可以将更Task.Delay改为like Task.Delay(100),这并不是我认为正确的解决方案。

c# asynchronous task async-await uwp

0
推荐指数
1
解决办法
108
查看次数

Use Variable in StringContent

Is it possible to have a variable in StringContent?

Currently my Code looks like this (It's about \"text\": \"this is my message\"):

myRequestMessage.Content = new StringContent("{\"type\": \"message\", \"text\": \"this is my message\", \"from\": {\"id\": \"myID\", \"name\": \"myName\"}}", System.Text.Encoding.UTF8, "application/json");
Run Code Online (Sandbox Code Playgroud)

But I want to have it like this (\"text\": "+myOwnString+"):

myOwnString = "this is my text";
myRequestMessage.Content = new StringContent("{\"type\": \"message\", \"text\": "+myOwnString+", \"from\": {\"id\": \"myID\", \"name\": \"myName\"}}", System.Text.Encoding.UTF8, "application/json");
Run Code Online (Sandbox Code Playgroud)

My problem is when doing it like …

c# string json

0
推荐指数
1
解决办法
63
查看次数