You haven't actually explained what the problem is - "not work" is useless as a problem description.
At a guess, you were expecting the value of the
valuereports
variable to be magically inserted into the string passed to the
Uri
constructor. But C# doesn't work like that.
(Imagine the confusion if it did: if you declared a variable string name = "Bob";
, and then tried to display a message of "Please enter your name:"
, you would actually display: "Please enter your Bob:"
!)
Instead, you need to tell the compiler that you want to insert the value of a variable into the string. There are several ways to do that; the simplest is probably to use
string interpolation[
^]:
WithoutAddOns.ServerReport.ReportServerUrl = new Uri($"http://{valureports}:80/WebServiceURL");