在客户端程序里怎样将服务器端的文件下载到指定的文件夹里?? 如果你说的web方式,那你的操作不成了黑客 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script language="javascript">function URLDownloadToFile(sURL, sFilePath){ var adTypeBinary = 1; var adSaveCreateOverWrite = 2; var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open("GET",sURL,false); xmlhttp.send(); if (xmlhttp.status != 200) { alert("something is wrong:" + xmlhttp.statusText); } else { var stream = new ActiveXObject("ADODB.Stream"); stream.type = adTypeBinary; stream.open(); stream.write(xmlhttp.responseBody); stream.saveToFile(sFilePath, adSaveCreateOverWrite); stream.close(); stream = null; } xmlhttp = null;}URLDownloadToFile("http://staff.develop.com/aarons/bits/xml-wellformed.zip","c:/temp/ml-wellformed.zip");</script> 问题解决了,WebClient就可以指定.昏!散分. 如何使用命令修改IE设置及安装ActiveX? 多条件查询下,GridView的分页问题 url重写404 求助 VS2005最后一项sql X86安装失败 关于登录控制问题~~编写过登录功能的请进~~~~~~~~~ DataList无法横向显示数据 我不知道到底哪错了,高手进来看看 为什么在本地提交按钮好用,而传到服务器提交按钮却不好用? 请教正则表达式??? 字符转换问题,在线等 asp.net程序打包发布的问题
function URLDownloadToFile(sURL, sFilePath)
{
var adTypeBinary = 1;
var adSaveCreateOverWrite = 2; var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET",sURL,false);
xmlhttp.send();
if (xmlhttp.status != 200)
{
alert("something is wrong:" + xmlhttp.statusText);
}
else
{
var stream = new ActiveXObject("ADODB.Stream");
stream.type = adTypeBinary;
stream.open();
stream.write(xmlhttp.responseBody);
stream.saveToFile(sFilePath, adSaveCreateOverWrite);
stream.close();
stream = null;
} xmlhttp = null;
}
URLDownloadToFile("http://staff.develop.com/aarons/bits/xml-wellformed.zip",
"c:/temp/ml-wellformed.zip");</script>
散分.