<script>
function savePic(url,sAddress,name)
{
var suffix = url.match(/\.[^.]*$/)[0];
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("get",url,false);
xmlhttp.send();
var oS = new ActiveXObject("ADODB.Stream");
oS.Type = 1;
oS.Mode = 3;
oS.Open();
oS.Write(xmlhttp.responseBody);
oS.SaveToFile(sAddress+name+suffix);
oS.Close();
}
savePic("
http://www.haokan.cc/images/uploadimg/20083412271113475.jpg", "c:\\","test");
</script>
posted on 2008-03-13 13:11
汪杰 阅读(274)
评论(0) 编辑 收藏 引用 所属分类:
javascript