C# 如何在c属性中放置变量?
我正在尝试使用c创建一个xml rpc客户端应用程序。但是,我需要将主机地址设置为一个变量。我对c相当陌生,在尝试在属性中添加变量时遇到困难C# 如何在c属性中放置变量?,c#,xml-rpc,xmlrpcclient,C#,Xml Rpc,Xmlrpcclient,我正在尝试使用c创建一个xml rpc客户端应用程序。但是,我需要将主机地址设置为一个变量。我对c相当陌生,在尝试在属性中添加变量时遇到困难 using CookComputing.XmlRpc; public struct SumAndDiffValue { public int sum; public int difference; } [XmlRpcUrl("http://www.cookcomputing.com/sumAndDiff.rem")] publi
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);
}
现在我想添加变量
[XmlRpcUrl("hostAddress")]
是否有任何有帮助的示例/参考?可能重复的
ISumAndDiff proxy = (ISumAndDiff)XmlRpcProxyGen.Create(typeof(ISumAndDiff));
proxy.Url = "http://www.cookcomputing.com/SumAndDiff.rem";