At the last
Mobile and Embedded DevCon held at
Bangalore, India, I spoke about the
Windows CE Remote API, better known as
RAPI.
RAPI is currently not available in the .NET Framework. To alleviate this issue, I have started working on a
managed RAPI to get the functionality in the managed world - following is how the code looks like:
CERapi rapi = new CERapi();
if (rapi.Init(5000) != InitReturnCode.Success)
Console.WriteLine("Unable to initialize RAPI");
else
{
Console.WriteLine("Initialized RAPI");
CESystemInformation si = rapi.SystemInformation;
// Processor Details
Console.WriteLine("Processor Architecture: {0}",si.ProcessorType.ToString());
Console.WriteLine("Processor Level: {0}",si.ProcessorLevel);
// OS Details
Console.WriteLine("OS: {0}",si.OSPlatform.ToString());
Console.WriteLine("Version: {0}.{1}.{2}",si.MajorVersion,si.MinorVersion,si.BuildNumber);
Console.WriteLine("CSD: {0}",si.CSDVersion);
// Storage Details
Console.WriteLine("Total Storage: {0} MB",si.StoreTotalSize/(1024.0*1024.0));
Console.WriteLine("Free Storage: {0} MB",si.StoreFreeSize/(1024.0*1024.0));
Console.WriteLine("Temp Folder: {0}",si.TempFolderPath);
Console.WriteLine("Programs Folder: {0}",si.GetSpecialFolder(CESpecialFolder.Programs));
// shutdown RAPI
if (rapi.Shutdown() == false)
Console.WriteLine("Unable to shutdown RAPI");
}
And heres' the sample output: