Hi,
Use the following code lines to get the site name. Note: This code works if the url is in the form of //" target=_blank>http://<servername>/<sitename>/.... Ex: http://server3/test/test1/Forms/template.xsn We will get the value ‘test' if we use the following code lines.
string url = thisXDocument.Solution.URI;
url = ((url.Remove(0, url.Substring(0, url.IndexOf("//") + 2).Length)).Remove(0, url.Substring(0, url.IndexOf("/") + 3).Length)).Substring(0, url.IndexOf("/") - 1);