public bool GetAttribute(string aKey, out string aValue) { IntPtr key = InteropUtils.StringToHGlobalUtf8(aKey); IntPtr value; int ret = CpDeviceCGetAttribute(iHandle, key, out value); Marshal.FreeHGlobal(key); if (ret != 0) { aValue = InteropUtils.PtrToStringUtf8(value); OhNetFree(value); return true; } aValue = null; return false; }
private void PrintDeviceInfo(string aPrologue, ControlPoint.CpDevice aDevice) { string location; aDevice.GetAttribute("Upnp.Location", out location); string friendlyName; aDevice.GetAttribute("Upnp.FriendlyName", out friendlyName); Console.Write(aPrologue + "\n udn = " + aDevice.Udn() + "\n location = " + location + "\n name = " + friendlyName + "\n"); }