001  <% @Page Language="C#" %>
002  <% @Assembly Name="System.Diagnostics" %>
003  <% @Import Namespace="System.Diagnostics" %>
004  <% @Import Namespace="System.Collections" %>
005  <script language="C#" runat="server">
006  void Page_Load(Object Src, EventArgs E)
007  {
008   if (!Page.IsPostBack)
009   {
010   PerformanceCounterCategory[] arrCategories = PerformanceCounterCategory.GetCategories();
011   Category.DataSource = arrCategories;
012   Category.DataBind();
013   }
014  }
015  
016  void OnDisplayCategory(Object sender, EventArgs e)
017  {
018   string strCategory = Category.SelectedItem.Value;
019   PerformanceCounterCategory pcInfo = new PerformanceCounterCategory(strCategory);
020  
021   CategoryHelp.Text = pcInfo.CategoryHelp;
022   CounterHelp.Text = "";
023  
024   PerformanceCounter[] arrCntrs = pcInfo.GetCounters();
025   Counters.DataSource = arrCntrs;
026   Counters.DataBind();
027  }
028  
029  void OnHelpCounter(Object sender, EventArgs e)
030  {
031   string strCategory = Category.SelectedItem.Value;
032   string strCounter = Counters.SelectedItem.Value;
033   PerformanceCounter pcInfo = new PerformanceCounter(strCategory, strCounter);
034   CounterHelp.Text = pcInfo.CounterHelp;
035  }
036  </script>
037  
038  <html>
039  <body>
040  
041  <h3>Performance Counter Hilfetexte</h3>
042  
043  <form runat="server" method="post">
044  <table width="400">
045  <tr><td valign="top">Kategorie:</td><td valign="top">Counter:</td></tr>
046  <tr><td valign="top">
047  <asp:dropdownlist id="Category" AutoPostBack="True"
048   DataTextField="CategoryName" DataValueField="CategoryName"
049   runat=server OnSelectedIndexChanged="OnDisplayCategory"/>
050  </td><td valign="top">
051  <asp:ListBox id="Counters" Width="200px" runat="server"
052   DataTextField="CounterName" DataValueField="CounterName"
053   AutoPostBack="True"
054   runat=server OnSelectedIndexChanged="OnHelpCounter"/>
055  </td></tr>
056  <tr><td colspan="2"><b>Kategorie:</b> <asp:Label id=CategoryHelp runat="server" /></td></tr>
057  <tr><td colspan="2"><b>Counter:</b> <asp:Label id="CounterHelp" runat="server" /></td></tr>
058  </table>
059  </form>
060  
061  </body>
062  </html>