fork download
  1. using static System.Console;
  2. using System.Reflection;
  3.  
  4. public class Program {
  5. public static void Main() {
  6. var xml = new Servico();
  7. var tipoServico = xml.GetType();
  8. tipoServico.InvokeMember("SalvarXmlRetornoEm", BindingFlags.SetProperty, null, xml, new object[] { "local" });
  9. WriteLine(xml.SalvarXmlRetornoEm);
  10. }
  11. }
  12.  
  13. //pra simplificar vou fazer um tipo em código mesmo
  14.  
  15. public class Servico {
  16. public string SalvarXmlRetornoEm { get; set; }
  17. }
  18.  
  19. //https://pt.stackoverflow.com/q/208767/101
Success #stdin #stdout 0.02s 16432KB
stdin
Standard input is empty
stdout
local