-2

I am trying to create a xml-rpc client application using c#. However I need to make host address a variable. I am fairly new to c# and having difficulties when trying to add variables in attributes.

using CookComputing.XmlRpc;

public struct SumAndDiffValue 
{
    public int sum; 
    public int difference; 
}

[XmlRpcUrl("http://www.cookcomputing.com/sumAndDiff.rem")] 
public interface ISumAndDiff : IXmlRpcProxy
{ 
  [XmlRpcMethod] 
  SumAndDiffValue SumAndDifference(int x, int y);
} 

Now I want to add variable in

[XmlRpcUrl("hostAddress")] 

Are there any examples/references that are helpful?

AustinWBryan
  • 3,249
  • 3
  • 24
  • 42
  • 3
    Possible duplicate of [Using variables within Attributes in C#](https://stackoverflow.com/questions/2827799/using-variables-within-attributes-in-c-sharp) – Camilo Terevinto Jul 21 '18 at 14:28

1 Answers1

0
ISumAndDiff proxy = (ISumAndDiff)XmlRpcProxyGen.Create(typeof(ISumAndDiff));
proxy.Url = "http://www.cookcomputing.com/SumAndDiff.rem";