@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: Retrieves operating statistics for a service. Currently, only the workstation and server services are supported. !!!!C# Signature: [DllImport("Netapi32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)] private extern static int NetStatisticsGet( [MarshalAs(UnmanagedType.LPWStr)] string serverName, [MarshalAs(UnmanagedType.LPWStr)] string service, int level, int options, out IntPtr BufPtr); !!!!VB Signature: Declare Function NetStatisticsGet Lib "Netapi32.dll" (TODO) As TODO !!!!User-Defined Types: None. !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: // // I found the following at http://www.codeproject.com/KB/cs/GetLastRebootTime.aspx by Gautham Jayaraman // static void Main(string[] args) { IntPtr bufPtr = IntPtr.Zero; int val = NetStatisticsGet(null, "LanmanWorkstation", 0, 0, out bufPtr); STAT_WORKSTATION_0 wks = new STAT_WORKSTATION_0(); if (val == 0) { wks = (STAT_WORKSTATION_0)Marshal.PtrToStructure(bufPtr, typeof(STAT_WORKSTATION_0)); } DateTime aRebootTime = DateTime.FromFileTime(wks.StatisticsStartTime); System.Console.WriteLine(aRebootTime); } // See [STAT_WORKSTATION_0] Documentation: NetStatisticsGet@msdn on MSDN (http://msdn.microsoft.com/en-us/library/bb525390(VS.85).aspx)
Edit netapi32.NetStati...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.