|
45 | 45 |
|
46 | 46 | The grammar's <xref:System.Speech.Recognition.Grammar.SpeechRecognized> event is raised when input matches a path through the grammar. |
47 | 47 |
|
| 48 | +[!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)] |
| 49 | +
|
48 | 50 | > [!NOTE] |
49 | | -> It is a best practice to verify the safety of any URI or DLL used to build a <xref:System.Speech.Recognition.Grammar> object. |
50 | | -> |
| 51 | +> It is a best practice to verify the safety of any URI or DLL used to build a <xref:System.Speech.Recognition.Grammar> object, which helps prevent security vulnerabilities when loading external resources. |
| 52 | +> |
51 | 53 | > Windows and the Speech platform provide security for applications constructing a <xref:System.Speech.Recognition.Grammar> instance from a DLL or from a grammar that supports scripting. |
52 | 54 | > |
53 | 55 | > Scripts in <xref:System.Speech.Recognition.Grammar> objects are always run as if downloaded from a web page in the `Internet Zone`. The Common Language Runtime (CLR) isolates any DLL loaded to obtain a grammar definition. |
@@ -944,6 +946,7 @@ private static Grammar CreateGrammarFromFile2() |
944 | 946 |
|
945 | 947 | This constructor does not validate `baseUri`. However, the `LoadGrammar` method of a <xref:System.Speech.Recognition.SpeechRecognitionEngine> or <xref:System.Speech.Recognition.SpeechRecognizer> object throws an exception if it cannot resolve all of the rule references in the grammar description. If `baseUri` is not `null`, the `LoadGrammar` method uses the URI to resolve any rule references that it cannot otherwise resolve. If `baseUri` represents a file, then the `LoadGrammar` uses both the designated file and the file's directory when it attempts to resolve relative rule references. |
946 | 948 |
|
| 949 | +[!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)] |
947 | 950 |
|
948 | 951 |
|
949 | 952 | ## Examples |
@@ -1112,7 +1115,7 @@ private static Grammar CreateGrammarFromStream3() |
1112 | 1115 |
|
1113 | 1116 | This constructor does not validate `baseUri`. However, the `LoadGrammar` method of a <xref:System.Speech.Recognition.SpeechRecognitionEngine> or <xref:System.Speech.Recognition.SpeechRecognizer> object throws an exception if it cannot resolve all of the rule references in the grammar description. If `baseUri` is not `null`, the `LoadGrammar` method uses the URI to resolve any rule references that it cannot otherwise resolve. If `baseUri` represents a file, then the `LoadGrammar` method uses both the designated file and the file's directory when it attempts to resolve relative rule references. |
1114 | 1117 |
|
1115 | | -
|
| 1118 | +[!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)] |
1116 | 1119 |
|
1117 | 1120 | ## Examples |
1118 | 1121 | The following example creates a speech recognition grammar in an <xref:System.Speech.Recognition.SrgsGrammar.SrgsDocument> that contains a relative rule reference to the cities.xml file, and specifies a URI to use to resolve the rule reference. The content of the cities.xml file appears in the XML example that follows the C# example. |
@@ -1276,6 +1279,8 @@ private static Grammar CreateSrgsDocumentGrammar3() |
1276 | 1279 | ## Remarks |
1277 | 1280 | Parameters for an initialization handler may also be specified. |
1278 | 1281 |
|
| 1282 | +[!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)] |
| 1283 | +
|
1279 | 1284 | ]]></format> |
1280 | 1285 | </remarks> |
1281 | 1286 | <exception cref="T:System.ArgumentException">- Any of the parameters contain an invalid value. |
@@ -1329,6 +1334,8 @@ private static Grammar CreateSrgsDocumentGrammar3() |
1329 | 1334 | ## Remarks |
1330 | 1335 | Parameters for an initialization handler may also be specified. |
1331 | 1336 |
|
| 1337 | +[!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)] |
| 1338 | +
|
1332 | 1339 | ]]></format> |
1333 | 1340 | </remarks> |
1334 | 1341 | <exception cref="T:System.ArgumentException">- Any of the parameters contain an invalid value. |
|
0 commit comments