MSBTS_ReceivePort.Name 属性 (WMI)

 

包含接收端口的名称。

显示的语法是非特定语言的。

语法

string Name;  

注解

创建实例时需要此属性。 此属性仅在创建实例时可写入。 创建实例后,此属性为只读。

此属性具有 密钥 限定符。 除了 MgmtDbNameOverrideMgmtDbServerOverride 外,此键还构成类的复合键。

此属性的最大长度为 256 个字符。

此属性包装托管 Microsoft.BizTalk.ExplorerOM.ReceivePort.Name 属性。

示例:

以下示例摘自 SDK\Samples\Admin\WMI\Remove Receive Port\VBScript\RemoveReceivePort.vbs 文件。

  
Sub RemoveReceivePort()  
   'Get the command line arguments entered for the script  
   Dim objArgs: Set objArgs = WScript.Arguments  
  
   'error handling is done by explicity checking the err object rather than using  
   'the VB ON ERROR construct, so set to resume next on error.  
   On Error Resume Next  
  
   'Make sure the expected number of arguments were provided on the command line.  
   'if not, print usage text and exit.  
   If (objArgs.Count <> 1) Then  
      PrintUsage()  
      WScript.Quit 0  
   End If  
  
   Dim objInstSet, objInst, strQuery  
   Dim strReceivePortName  
  
   strReceivePortName = objArgs(0)  
  
   'set up a WMI query to acquire a list of receive locations with the given Name and   
   'ReceivePortName key values.  This should be a list of zero or one Receive Locations.  
   strQuery = "SELECT * FROM MSBTS_ReceivePort WHERE Name =""" & strReceivePortName & """"  
   Set objInstSet = GetObject("Winmgmts:!root\MicrosoftBizTalkServer").ExecQuery(strQuery)  
  
   'Check for error condition before continuing.  
   If Err <> 0   Then  
      PrintWMIErrorThenExit Err.Description, Err.Number  
   End If  
  
   'If Receive Location found, enable it, otherwise print error and end.  
   If objInstSet.Count > 0 then  
      For Each objInst in objInstSet  
         'Now remove the receive port  
         objInst.Delete_()  
         If Err <> 0   Then  
            PrintWMIErrorThenExit Err.Description, Err.Number  
         End If  
         WScript.Echo "The Receive Port was successfully removed."  
      Next  
   Else  
      WScript.Echo "No Receive Port was found matching that Name."  
   End If  
  
End Sub  
  

C# 未提供任何示例。

要求

页眉: 在 BTSWMISchema2K.mof 或 BTSWMISchemaXP.mof 中声明。

Namespace: 包含在 \root\MicrosoftBizTalkServer 中。