How get password with ReadPasswordHardware

I try to get the password of the hardware, but the password is empty. is it correct:

	var camera = new VideoOS.Platform.ConfigurationItems.Camera(cameraFQID);
 
 
 
	var hardware = new Hardware(
 
 EnvironmentManager.Instance.CurrentSite.ServerId,
 
 camera.ParentItemPath
 
	);
 
 
 
	string password = "";
 
	try
 
	{
 
 MessageBox.Show($"Attempting to read password... {hardware.Id}");
 
 
 
 ServerTask passwordTask = hardware.ReadPasswordHardware();
 
 
 
 while (passwordTask.State != StateEnum.Error && passwordTask.State != StateEnum.Success)
 
 {
 
 System.Threading.Thread.Sleep(100);
 
 passwordTask.UpdateState();
 
 }
 
 password = hardware.GetProperty("PasswordHardware");
 
 
 
	}

You need to read the password from the task. I found this in some test code of mine.

private string FindCameraPassword(Hardware hardware)
{
	ServerTask servertask = hardware.ReadPasswordHardware();
	return servertask.GetProperty("Password");
}

Thank you, It’s working now.