Beispiel #1
0
        /// <summary>Create a ServerStatisticsInfo instance from the specified host name.</summary>
        internal WorkstationStatisticsInfo(string hostName, NativeMethods.STAT_WORKSTATION_0?workstationStat)
        {
            HostName = !Utils.IsNullOrWhiteSpace(hostName) ? hostName : Environment.MachineName;

            if (workstationStat.HasValue)
            {
                _workstationStat = (NativeMethods.STAT_WORKSTATION_0)workstationStat;
            }

            else
            {
                Refresh();
            }
        }
Beispiel #2
0
 /// <summary>Refreshes the state of the object.</summary>
 public void Refresh()
 {
     _workstationStat = Host.GetNetStatisticsNative <NativeMethods.STAT_WORKSTATION_0>(false, HostName);
 }