FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
GetSystemInfo en ASP .NET
Hola.
¿Se puede obtener la misma información en una aplicación ASP .NET del hardware del sistema, como si se hiciera un GetSystemInfo? Gracias. Saludos. |
#2
|
||||
|
||||
Del hardware de que sistema? Supongo que hablas del servidor, no?
__________________
Héctor Geraldino Software Engineer |
#3
|
|||
|
|||
Sí, del servidor.
|
#4
|
||||
|
||||
No lo he probado en .NET, pero puedes intentar llamar el API getsysteminfo de la dll kernel32.dll (api del sistema operativo)
En c# va mas o menos asi : Código:
using System.Runtime.InteropServices; //Estructura que sera parametro de la funcion [StructLayout(LayoutKind.Sequential)] public struct SYSTEM_INFO { public uint dwOemId; public uint dwPageSize; public uint lpMinimumApplicationAddress; public uint lpMaximumApplicationAddress; public uint dwActiveProcessorMask; public uint dwNumberOfProcessors; public uint dwProcessorType; public uint dwAllocationGranularity; public uint dwProcessorLevel; public uint dwProcessorRevision; } [DllImport("kernel32.dll")] static extern void GetSystemInfo(ref SYSTEM_INFO pSI); // y de aqui lo invocamos protected void button1_Click (object sender, System.EventArgs e) { SYSTEM_INFO pSI = new SYSTEM_INFO(); GetSystemInfo(ref pSI); Response.Write(pSI.dwActiveProcessorMask.ToString()); }
__________________
Héctor Geraldino Software Engineer |
|
|
|