如何将值传递给以@开头的c#参数

Ani*_*udh 1 c# asp.net string url parameter-passing

试图传递价值但不取得进展.

场景:拥有一个公共常量字符串,如下所示.

public const string ImageFile = @"http://xyz.com/scom/{0}?type={1}&wid={2}";
Run Code Online (Sandbox Code Playgroud)

然后,我将获得上述所需的0,1,2所需的相关值.

问题是如何将我对0,1,2的值传递给上面的const字符串?

我的最终结果应该是这样的

string mySTring = "http://xyz.com/scom/123?type=jpg&wid=200"
Run Code Online (Sandbox Code Playgroud)

请建议.

谢谢.

zmb*_*mbq 9

使用String.Format:

string ActualImageFile = String.Format(ImageFile, param1, param2, param3);
Run Code Online (Sandbox Code Playgroud)