I have the following code snippet:
string tmp = String.Format(\"
You can also use the properties of URIBuilder for this, it has properties for outputting an url the way you want