コード例 #1
0
        protected string GetSPSite()
        {
            if (String.IsNullOrWhiteSpace(Site) || Site.StartsWith("http://") || Site.StartsWith("https://"))
            {
                return(Site);
            }


            var fileName = GetPresetFilename(Site);

            if (!File.Exists(fileName))
            {
                throw new RuntimeException($"File not found: \"{fileName}\"");
            }

            SearchConnection sc = new SearchConnection();

            sc.Load(fileName);

            if (sc.SpSiteUrl == null)
            {
                throw new ArgumentException($"Unable to load valid saved site information from the file \"{fileName}\"");
            }

            return(sc.SpSiteUrl);
        }
コード例 #2
0
        private string GetSPSite()
        {
            if (String.IsNullOrWhiteSpace(Site) || Site.StartsWith("http://") || Site.StartsWith("https://"))
            {
                return(Site);
            }


            var fileName = GetPresetFilename(Site);

            SearchConnection sc = new SearchConnection();

            sc.Load(fileName);

            return(sc.SpSiteUrl);
        }