获取当前SILVERLIGHT程序存放网络URL的前缀

来源:互联网 发布:mysql insert 死锁 编辑:程序博客网 时间:2024/06/04 23:48
/// <summary>        /// 获取当前SILVERLIGHT程序存放网络URL的前缀        /// </summary>        /// <returns>URL前缀</returns>        public static string GetUrl()        {            ScriptObject location = (HtmlPage.Window.GetProperty("location")) as ScriptObject;//获取当前脚本对象            object r = location.GetProperty("href");            string URL = r.ToString().Substring(0, r.ToString().LastIndexOf('/'));//截取到当前SILVERLIGHT程序存放网络URL的前缀            return URL;        }

原创粉丝点击