if( response.ContentType.ToLower().StartsWith("image/") ) ...{ byte[] arrayByte = new byte[1024]; int imgLong = (int)response.ContentLength; int l = 0;
if(fileName == "") fileName = imgName;
FileStream fso = new FileStream(path+fileName+imgType,FileMode.Create); while(l<imgLong) ...{ int i = stream.Read(arrayByte,0,1024); fso.Write(arrayByte,0,i); l += i; }