for (int counter = 0; counter <= temparray.Length - 1; counter = counter + 1)
{
if ((counter < temparray.Length + 2) && (temparray[counter] == "><img") && (temparray[counter + 1] == "id='header-img'"))
{
string j = temparray[counter + 2];
int startIndex = j.IndexOf('"') + 1;
int length = j.IndexOf('"', startIndex) - startIndex;
string jj = (j.Substring(startIndex, length));
client.DownloadFile(jj, @"C:\image.png");
}
}
我获取的图像的URL保存为名为jj
的字符串,但后来我试图将其保存到任何文件夹中而不是成功。