Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   .NET (https://www.clubdelphi.com/foros/forumdisplay.php?f=17)
-   -   GetSystemInfo en ASP .NET (https://www.clubdelphi.com/foros/showthread.php?t=23972)

migsoftware 04-08-2005 01:39:16

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.

__hector 05-08-2005 20:33:29

Del hardware de que sistema? Supongo que hablas del servidor, no?

migsoftware 07-08-2005 01:05:56

Sí, del servidor.

__hector 15-08-2005 18:53:18

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());
}



La franja horaria es GMT +2. Ahora son las 02:09:58.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi