/// <summary> /// 获取存在替换连接的本地路径,不存在返回空 /// </summary> /// <param name="psnurl"></param> /// <returns></returns> public string PsnLocalPath(string psnurl) { try { UrlInfo temp = DataHistory.Instance().GetInfo(psnurl); if (temp != null && !String.IsNullOrEmpty(temp.ReplacePath)) { return(temp.ReplacePath); } if (!AppConfig.Instance().IsAutoFindFile) { return(String.Empty); } //如果开启自动匹配本地文件,则自动查找 string filename = GetUrlFileName(psnurl); if (!String.IsNullOrEmpty(filename)) { return(Path.Combine(AppConfig.Instance().LocalFileDirectory, filename)); } return(string.Empty); } catch (Exception ex) { return(string.Empty); } }
public static DataHistory Instance() { if (_instance == null) lock (Lock) { _instance = new DataHistory(); if (!File.Exists(Xmlpath)) { CreatXml(); return _instance; } _datas = XElement.Load(Xmlpath); } return _instance; }
/// <summary> /// 获取存在的离线路径 /// </summary> /// <param name="psnurl"></param> /// <param name="lixianurl"></param> /// <returns></returns> public bool GetLixianUrl(string psnurl, out string lixianurl) { lixianurl = null; try { UrlInfo temp = DataHistory.Instance().GetInfo(psnurl); if (temp != null) { lixianurl = temp.LixianUrl; return(temp.IsLixian); } return(false); } catch { return(false); } }
public static DataHistory Instance() { if (_instance == null) { lock (Lock) { _instance = new DataHistory(); if (!File.Exists(Xmlpath)) { CreatXml(); return(_instance); } _datas = XElement.Load(Xmlpath); } } return(_instance); }