如何获取网页的源代码!

chenglong01 2004-03-25 05:40:13
求助!!谢谢
...全文
100 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
outspaceman 2004-03-25
  • 打赏
  • 举报
回复
http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=66D96FB4-CBB6-4D44-DAAD-B76719E8F2FF
pdsinfo 2004-03-25
  • 打赏
  • 举报
回复
用WebClient组件,详见
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfsystemnetwebclientclassdownloadfiletopic.htm

下面的示例将文件从 http://www.contoso.com 下载到本地硬盘。
string remoteUri = "http://www.contoso.com/library/homepage/images/";
string fileName = "ms-banner.gif", myStringWebResource = null;
// Create a new WebClient instance.
WebClient myWebClient = new WebClient();
// Concatenate the domain with the Web resource filename.
myStringWebResource = remoteUri + fileName;
Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n", fileName, myStringWebResource);
// Download the Web resource and save it into the current filesystem folder.
myWebClient.DownloadFile(myStringWebResource,fileName);
Console.WriteLine("Successfully Downloaded File \"{0}\" from \"{1}\"", fileName, myStringWebResource);
Console.WriteLine("\nDownloaded file saved in the following file system folder:\n\t" + Application.StartupPath);
vasun 2004-03-25
  • 打赏
  • 举报
回复
啊,很简单的,查看源文件。
xiangyangsunboy1 2004-03-25
  • 打赏
  • 举报
回复
右键---->查看源文件
chenglong01 2004-03-25
  • 打赏
  • 举报
回复
在线等待,

110,536

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧