共用方式為


TextInteraction Complex Type

Defines an interaction used to get text input from the user.

<xs:complexType name="TextInteraction">
    <xs:sequence>
        <xs:element name="RegularExpression"
            type="xs:string"
            minOccurs="1"
            maxOccurs="1"
         />
        <xs:element name="ID"
            type="dcmPS:ID"
            minOccurs="1"
            maxOccurs="1"
         />
        <xs:element name="DisplayInformation"
            type="dcmPS:DisplayInformation"
            minOccurs="1"
            maxOccurs="1"
         />
        <xs:element name="ContextParameters"
            type="dcmPS:Parameters"
            minOccurs="1"
            maxOccurs="1"
         />
        <xs:element name="ExtensionPoint"
            type="dcmPS:ExtensionPoint"
            minOccurs="1"
            maxOccurs="1"
         />
    </xs:sequence>
</xs:complexType>

Child elements

Element Type Description
ContextParameters [dcmPS:Parameters](package-parameters-complextype.md) Some extension points can contain substitution strings (for example, %param%). Each substitution string in the extension point is replaced with the value of the same named parameter specified in this list.
DisplayInformation [dcmPS:DisplayInformation](package-displayinformation-complextype.md) The name and description of this interaction that is used in the UI. The name is used as the prompt for the text box.
ExtensionPoint [dcmPS:ExtensionPoint](package-extensionpoint-complextype.md) An extension point that extends this interaction. Each extension is a child element of ExtensionPoint. The extension points are MSDT specific and are not supported by the command-line client using the [Invoke-TroubleshootingPack](invoke-troubleshootingpack-cmdlet.md) cmdlet. You can specify one or more of the following extensions (but only one of each).
Extension Description
Browse Includes a Browse button with a single-line text box. The Browse element can contain one of the following items:
  • Computer used to select a computer on the network (network discovery must be turned on for this option to work)
  • File used to select a file in a folder
  • Folder used to select a folder on the computer

For File and Folder, the path used is %HOMEDRIVE%%HOMEPATH%.
If you specify File, you must include the FilterText and FilterExtension attributes. For example, <Browse FilterText="@diag.dll,-123" FilterExtension="*.exe">File</Browse>. For a description of allowed values for FilterExtension, see the lpstrFilter member of the OPENFILENAME structure.
Default Provides the default text string to show in the text box.
The default string can contain substitution strings (for example, %param%) that are specified in the ContextParameters element.
The Default element can contain a literal string or a resource identifier for the localized text string (for example, "@diag.dll,-123".
EditMode Determines whether the edit box is a single line or multiline edit box. The text value of the EditMode element can contain one of the following values:
  • Multi
  • Single

Eula Displays a EULA page to the user. The EditMode must be set to Multiple. If the user accepts the agreement, the interaction returns the string, "Accept". The Description element of [DisplayInformation](package-displayinformation-complextype.md) contains the EULA text. The Eula element has no content.
Link Creates a link to the specified URL. The link is placed at the bottom of the interaction window. You must use this extension point in conjunction with the LinkText extension point.
The URL can contain substitution strings (for example, %param%) that are specified in the ContextParameters element.
The URL must begin with http, https, or mshelp.
LinkText The text to use for a link. The contents of the LinkText element is the resource identifier of the localized string. You must use this extension point in conjunction with the Link extension point.
The link text can contain substitution strings (for example, %param%) that are specified in the ContextParameters element.
NoCache By default, the answer to an interaction is cached. When running in MSDT, if the interaction is called more than one time, the interaction is shown the first time and the cached answer is used thereafter (without displaying the interaction). Use this extension point to force the interaction to display on subsequent requests and to not get the answer from the cache.
This extension is ignored if you run the pack from a command-line and provide an answer file that provides an answer for the interaction.
This extension's usage is NoCache/.
NoUI Suppresses the interaction. Gets the responses to the interaction from the answer file rather than from the user. For details on using an answer file, see the [Get-TroubleshootingPack](get-troubleshootingpack-cmdlet.md) and [Invoke-TroubleshootingPack](invoke-troubleshootingpack-cmdlet.md) cmdlets. This extension's usage is NoUI/.
RTFDescription A rich text format string that replaces the Description element of [DisplayInformation](package-displayinformation-complextype.md). If the client does not support rich text, the description string is used.
The RTF string can contain substitution strings (for example, %param%) that are specified in the ContextParameters element.
The RTFDescription element can contain an RTF string or a localized resource string (for example, "@diag.dll,-123" or "@diag.dll,RESOURCE.RTF")

ID [dcmPS:ID](package-id-simpletype.md)

An identifier that identifies this interaction.

RegularExpression xs:string

A regular expression string that specifies the type of input that the user is allowed to enter.

Remarks

WTP uses the regular expression syntax supported by the CAtlRegExp class found in the ATL Server Library Reference.

The MSDT client will not prevent the user from entering text that does not conform to the regular expression, but the interaction will not proceed until the user enters the text correctly. If you use a regular expression, consider using the Description node of DisplayInformation to tell the user the type of input that they can enter.

The troubleshooting engine uses the regular expression to validate the text input after it is entered. If the input is not valid, the engine returns an error to the script.

Requirements

Minimum supported client
Windows 7 [desktop apps only]
Minimum supported server
Windows Server 2008 R2 [desktop apps only]

See also

TextInteraction (TextInteractions) Element

TextInteractions Complex Type