次の方法で共有


MSBTS_ReceiveLocation.Name プロパティ (WMI)

 

受信場所の名前を表します。

ここに示す構文は、特定の言語に依存しません。

構文

string Name;  

解説

このプロパティは、インスタンスの作成時には書き込み可能ですが、 インスタンスの作成後は、読み取り専用になります。

このプロパティには Key 修飾子があります。 MgmtDbNameOverrideReceivePortNameMgmtDbServerOverride と共に、このキーは クラスの複合キーを形成します。

このプロパティの最大長は 128 文字です。

このプロパティは、マネージド Microsoft.BizTalk.ExplorerOM.ReceiveLocation.Name プロパティをラップします。

次の例は、SDK\Samples\Admin\WMI\Enumerate Receive Locations\VBScript\EnumRecLocs.vbs ファイルからの抜粋です。

  
Sub EnumRecLocs()  
  
   '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  
  
   Dim InstSet, Inst  
   set InstSet = GetObject ("winmgmts:\root\MicrosoftBizTalkServer").InstancesOf("MSBTS_ReceiveLocation")  
  
   'Check for error condition before continuing.  
   If Err <> 0   Then  
      PrintWMIErrorThenExit Err.Description, Err.Number  
   End If  
  
   'Report on number of receive locations found and list each one.  
   wscript.echo "A Total of " & InstSet.Count & " Receive Locations were found."  
   If InstSet.Count > 0 Then  
      For Each Inst In InstSet  
         wscript.echo  
         wscript.echo "Receive Location Name: " & Inst.Name  
         wscript.echo "  Disabled           : " & Inst.IsDisabled  
         wscript.echo "  Pipeline Name      : " & Inst.PipelineName  
         wscript.echo "  Receive Port Name  : " & Inst.ReceivePortName  
         wscript.echo  
      next  
   End If   
  
End Sub  
  

次の例は、SDK\Samples\Admin\WMI\Enumerate Receive Locations\CSharp\EnumRLs.cs ファイルからの抜粋です。

  
static void Main(string[] args)  
{  
   // Display help information   
   if (args.Length > 0)  
   {  
         if (args[0] == "/?")   
         {  
            Console.WriteLine();  
            Console.WriteLine();  
            Console.WriteLine("The correct usage of this sample is \"EnumRL.exe [RLName]\"");  
            Console.WriteLine("Where [RLname] is the name of a particular receive location to enumerate.");  
            Console.WriteLine("If receive location name contains spaces make sure to put it in quotes");   
            Console.WriteLine();  
            Console.WriteLine("Example #1 Enumerate all the receive locations.");  
            Console.WriteLine("         EnumRL");  
            Console.WriteLine();  
            Console.WriteLine("Example#2 enumerate just the \"My Receive Location #3\" receive location.");   
            Console.WriteLine("         EnumRL \"My Receive Location #3\" ");  
            Console.WriteLine();  
            Console.WriteLine();  
            Console.WriteLine("To get help use enumRL.exe /?");  
            return;  
         }  
   }  
  
   try   
   {     
      //Create the WMI search object.  
      ManagementObjectSearcher Searcher = new ManagementObjectSearcher();  
  
      // create the scope node so we can set the WMI root node correctly.  
      ManagementScope Scope = new ManagementScope("root\\MicrosoftBizTalkServer");  
      Searcher.Scope = Scope;  
  
      // Build a Query to enumerate the MSBTS_ReceiveLocation instances if an argument  
      // is supplied use it to select only the matching RL.  
      SelectQuery Query = new SelectQuery();   
      if (args.Length == 0)   
         Query.QueryString="SELECT * FROM MSBTS_ReceiveLocation";  
      else  
         Query.QueryString="SELECT * FROM MSBTS_ReceiveLocation WHERE Name = '" + args[0] + "'";  
  
      // Set the query for the searcher.  
      Searcher.Query = Query;  
  
      // Execute the query and determine if any results were obtained.  
      ManagementObjectCollection QueryCol = Searcher.Get();  
  
      // Use a bool to tell if we enter the for loop  
      // below because Count property is not supported  
      bool ReceiveLocationFound = false;  
  
      // Enumerate all properties.  
      foreach (ManagementBaseObject envVar in QueryCol)  
      {  
         // There is at least one Receive Location  
         ReceiveLocationFound = true;  
  
         Console.WriteLine("**************************************************");  
         Console.WriteLine("Receive Location:  {0}", envVar["Name"]);  
         Console.WriteLine("**************************************************");  
  
         PropertyDataCollection envVarProperties = envVar.Properties;  
         Console.WriteLine("Output in the form of: Property: {Value}");  
  
         foreach (PropertyData envVarProperty in envVarProperties)   
         {                 
            Console.WriteLine(envVarProperty.Name+ ":\t" + envVarProperty.Value);  
         }  
      }  
  
      if (!ReceiveLocationFound)   
      {  
         Console.WriteLine("No receive locations found matching the specified name.");  
      }   
   }  
  
   catch(Exception excep)  
   {  
      Console.WriteLine(excep.ToString());  
   }  
  
   Console.WriteLine("\r\n\r\nPress Enter to continue...");  
   Console.Read();  
}  
  

必要条件

ヘッダー: BTSWMISchemaXP.mof で宣言されています。

名前空間: \Root\MicrosoftBizTalkServer