Windows 10搜索API

时间:2015-10-28 19:29:32

标签: windows search microsoft-metro windows-10 cortana

我希望用户能够在Windows 10搜索框中输入产品ID,并让它显示网络数据库中的产品列表,然后当他们点击该产品ID时,让它加载一个来自我们内部网的网页。这可能吗?我是否需要在计算机上安装一个桌面应用程序供Cortana搜索?

1 个答案:

答案 0 :(得分:0)

您需要创建一个带有VCD文件的UWP应用程序,您需要设置Cortana如何调用您的应用程序。 Lat's说你的应用程序被称为"找到它"或者什么,然后,你可以告诉cortana,无论何时某人说或类型"找到它"在其搜索框中"她"必须在"找到"之后给你的应用程序打电话。作为参数。

        if (eventObject.detail.kind === Windows.ApplicationModel.Activation.ActivationKind.voiceCommand) {
        var speechRecognitionResult = eventObject.detail.result;

        // Get the name of the voice command. 
        // For this example, we declare only one command.
        var voiceCommandName = speechRecognitionResult.rulePath[0];

        // Get the actual text spoken.
        var textSpoken = speechRecognitionResult.text !== undefined ? speechRecognitionResult.text : "EXCEPTION";
相关问题