In the case when we need to get the absolute url for any item, we can make use of the instance method SPSite.MakeFullUrl.
Example use,-
using(SPSite site = new SPSite(mysiteurl)){ using(SPWeb web = site.OpenWeb()) { //.. Other lines of code string absoluteURL = site.MakeFullUrl(serverRelativeURL); }}