I would like to track what type of devices my app is being run on...I've
already got versioning info from the Environment class, but I can't seem to
find out how to get the device manufacturer, model, etc... TIA
You can check the OEM for some manufacturers through a p/invoke
call...
[System.Runtime.InteropServices.DllImport("coredll.dll")]
private static extern int SystemParametersInfo(int uiAction, int
uiParam, string pvParam, int fWinIni);
public enum ReaderUnitTypes
{
None,
Dolphin,
Symbol,
}
public static ReaderUnitTypes GetOemInfo()
{
const int SPI_GETOEMINFO = 258;
string oemInfo = new string(' ', 50);
int result = SystemParametersInfo(SPI_GETOEMINFO, 50, oemInfo,
0);
oemInfo = oemInfo.Substring(0,
oemInfo.IndexOf('\0')).ToUpper();
ReaderUnitTypes readerType = ReaderUnitTypes.None;
// Be sure to use upper case text when doing an IndexOf.
if (oemInfo.IndexOf("HHP") > -1)
{
readerType = ReaderUnitTypes.Dolphin;
}
else if (oemInfo.IndexOf("SYMBOL") > -1)
{
readerType = ReaderUnitTypes.Symbol;
}
return readerType;
}