从URL下载数据到本地文件
2009-03-01 14:07
260 查看
http://localhost:3148/test2/Default7.aspx
设置
高级
请输入URL:
已经下载,请自行检查c:/www.baidu.com.html
登录
空间 hao123 | 更多>>
把百度设为主页
企业推广 | 搜索风云榜 | 关于百度 | About Baidu
©2009 Baidu 使用百度前必读 京ICP证030173号
code:
<%@ Import Namespace="System.net" %>
<%@ Import NameSpace="System.IO" %>
<script language ="vb" runat="server">
Sub Enter_click(ByVal sender As Object, ByVal e As EventArgs)
Dim wc As New WebClient()
Dim filePath As String
filePath = "c:/" & Path.GetFileName(txtURL.Text) & ".html"
wc.DownloadFile(txtURL.Text, filePath)
message.text = "已经下载,请自行检查" & filePath
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
请输入URL:
<br />
<asp:TextBox ID="txtURL" runat="server"></asp:TextBox>
<asp:Button ID ="enter" Text ="确定" OnClick="enter_click" runat="server" />
<p></p><asp:label ID="message" runat="server"/>
</div>
</form>
</body>
</html>
设置
高级
请输入URL:
已经下载,请自行检查c:/www.baidu.com.html
登录
新 闻网 页贴 吧知 道MP3图 片视 频 |
企业推广 | 搜索风云榜 | 关于百度 | About Baidu
©2009 Baidu 使用百度前必读 京ICP证030173号
code:
<%@ Import Namespace="System.net" %>
<%@ Import NameSpace="System.IO" %>
<script language ="vb" runat="server">
Sub Enter_click(ByVal sender As Object, ByVal e As EventArgs)
Dim wc As New WebClient()
Dim filePath As String
filePath = "c:/" & Path.GetFileName(txtURL.Text) & ".html"
wc.DownloadFile(txtURL.Text, filePath)
message.text = "已经下载,请自行检查" & filePath
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
请输入URL:
<br />
<asp:TextBox ID="txtURL" runat="server"></asp:TextBox>
<asp:Button ID ="enter" Text ="确定" OnClick="enter_click" runat="server" />
<p></p><asp:label ID="message" runat="server"/>
</div>
</form>
</body>
</html>
相关文章推荐
- 从URL下载数据到本地文件
- 根据URL将文件下载本地
- 下载远程url文件(或者文件流)到本地
- JAVA通过访问页面中的URL实现Http文件下载到本地
- [MFC]下载一个url的源文件到本地文件
- jsp内存数据下载到本地--弹出的文件保存框时 两次调用action中下载方法问题
- python 使用 urllib.urlretrieve()下载网络图片,在本地打开提示文件损坏无法打开
- 从URL地址将文件按行下载到本地
- QTP 通过URL地址下载文件到本地
- asp.net(c#)从url网络地址下载图片或文件到本地硬盘
- 根据url地址下载文件到本地,返回本地文件地址
- Java 通过URL地址下载文本内容到本地文件中
- 爪哇国新游记之二十八----从url指定的地址下载文件到本地
- JAVA 实现通过URL下载文件到本地库
- 根据url地址下载文件到本地,返回本地文件地址
- 从网络Url中下载文件到本地
- 读取文件中的URL,下载到本地,删除原文件
- 从URL下载数据到本地变量
- C#根据指定url下载文件并读取.csv数据转为json格式
- 根据URL下载文件到本地(将二进制文件保存到磁盘)