Main Site Documentation

How can i get deviceID? or how can i set/get device id, serial number etc?


#1

I want to operate ER_Config:

  1. Add some configures of my app to the ER_Config using deployment tool;
  2. Get those configures in my app;

Is OK?


#2

@ chulaiguo - It would probably be easiest to create a class to hold all of your settings and save this with extended weak reference


#3

extended weak reference is stable? I write configure file with ewr, sometime the configure file has lost, why? code example:

private static ExtendedWeakReference _EWRDevice;

public static DeviceInfo LoadDeviceInfo()
{
try
{
_EWRDevice = ExtendedWeakReference.RecoverOrCreate(
typeof(DeviceInfo), 0, ExtendedWeakReference.c_SurvivePowerdown);
_EWRDevice.Priority = (Int32)ExtendedWeakReference.PriorityLevel.System;

            DeviceInfo data = (DeviceInfo)_EWRDevice.Target;
            if (data == null)
            {
                data = new DeviceInfo();
                data.DeviceID = "2b002a00-1147-3034-3236-3335e1501000";//for test
            }

            return data;
        }
        catch (Exception ex)
        {
            Debug.Print(ex.Message);
            return new DeviceInfo();
        }
    }

#4

There is also a flush ewr method hidden in the GHI library :slight_smile:


#5

We had bad experiences with EWR. Sometimes EWR wans not recovered without knowing the reason. After some discussion with GHI people on the forum, we decided to not use EWR anymore.