コード例 #1
0
        private static string ReplaceImageServerUrl(string content)
        {
            string imageServerUrl = Globals.GetImageServerUrl();

            if (!string.IsNullOrEmpty(imageServerUrl))
            {
                if (content.ToLower().StartsWith("/storage/"))
                {
                    content = content.ToLower().Replace("/storage/", imageServerUrl + "/storage/");
                }
                content = content.Replace(" src=\"/storage/", " src=\"" + imageServerUrl + "/storage/").Replace(" src='/storage/", " src='" + imageServerUrl + "/storage/").Replace(" href=\"/storage/", " href=\"" + imageServerUrl + "/storage/")
                          .Replace(" href='/storage/", " href='" + imageServerUrl + "/storage/");
            }
            return(content);
        }