1 获取URL地址
Url = Application.Current.Host.Source.Scheme + "://" + Application.Current.Host.Source.DnsSafeHost + ":" + Application.Current.Host.Source.Port;
2 获取Web URL地址
Uri uri = new Uri(Application.Current.Host.Source, "../");
1 获取URL地址
Url = Application.Current.Host.Source.Scheme + "://" + Application.Current.Host.Source.DnsSafeHost + ":" + Application.Current.Host.Source.Port;
2 获取Web URL地址
Uri uri = new Uri(Application.Current.Host.Source, "../");