Device name through desktop application

Last post 09-11-2008 3:37 by Chris Type R. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-19-2008 9:02

    Device name through desktop application

     Is there any way to get the name of the connected windows ce 5.0 device through the desktop application using RAPI. My desktop application is in VB.net.

    Please help me out.

    Thanks in advance. 

     

     

     

    Filed under:
  • 09-11-2008 3:37 In reply to

    Re: Device name through desktop application

    Here's something that I've used:
    #region GetDeviceName
    
    public static string GetDeviceName()
    
    {
        string result = string.Empty;
    
        RAPI rapi = new RAPI();
        rapi.Connect(true);
        try
        {
            CERegistryKey key = CERegistry.LocalMachine.OpenSubKey(@"Ident");
            if (key != null)
            {
                object deviceNameValue = key.GetValue(@"Name");
                if (deviceNameValue != null)
                    result = deviceNameValue.ToString();
            }
        }
        finally
        {
            rapi.Disconnect();
        }
        return (result);
    }
    
    #endregion
    
Page 1 of 1 (2 items)