public string GetProperty( string device, params string[] propertyNames ) { foreach ( var item in propertyNames ) { PropertyCommandResult pcr = new PropertyCommandResult ( ShellRun ( device, string.Format ( CultureInfo.InvariantCulture, "getprop {0}", item ) ).Output.ToString ( ) ); if ( !String.IsNullOrEmpty ( pcr.Value ) ) { return pcr.Value; } } return null; }
/// <summary> /// Gets the property. /// </summary> /// <param name="device">The device.</param> /// <param name="propertyName">Name of the property.</param> /// <returns></returns> public string GetProperty( string device, string propertyName ) { PropertyCommandResult pcr = new PropertyCommandResult ( ShellRun ( device, string.Format ( CultureInfo.InvariantCulture, "getprop {0}", propertyName ) ).Output.ToString ( ) ); return pcr.Value; }