我有一个单独的列包含多个URL由“,”单独我希望得到这些URL正确并在我的asp.net页面中显示J查询Slider。
列详细信息 “ID”,“URLS” 1,www.abc.com / abc.jpg,wwww.bcd.com/ced.jpeg, 一个单列值中的大量图像URL。
需要你的建议
答案 0 :(得分:0)
string sPhotoURL = Convert.ToString(dt.Rows[0]["PHOTO_LOCATIONColumnName"]);
string[] words = sPhotoURL.Split(',');
int count = 0;
hdnImageCount.Value = words.Length.ToString();
foreach (string word in words)
{
if (word.Length > 50)
{
count += 1;
String correctURl = word.Substring(45);
string photoNumber = correctURl.Substring(1, 2);
correctURl = "http://" + "images-+photoNumber+urlsomething/something/"+correctURl;
string url = correctURl;
}
}
这将使我的URl正确,之后我将其传递给下载图像的功能。
谢谢大家通过以下代码完成此操作......