摘要:一般 -- 取得Silverlight所在的網域
public string GetHost()
{
string domain = string.Empty;
try
{
string htmloc = HtmlPage.Window.Eval("window.location.href;") as string;
domain = htmloc.Replace("http://", String.Empty);
if (domain.Contains("/"))
domain = "http://" + domain.Substring(0, domain.IndexOf("/"));
}
catch
{
return string.Empty;
}
return domain;
}