编程:手机网站怎么下载下来html源代码

html-css016

编程:手机网站怎么下载下来html源代码,第1张

你好,主要有一下方法:

方法一、查看html源码的站点

百度“查看网页源码”,有很多支持查看网页源码的在线站点。

方法二、QQ浏览器 + ES文件管理器

使用QQ浏览器打开网页,长按,“保存离线网页”。

打开ES文件管理器,打开路径“存储卡/QQBrowser/网页保存”,打开方式选择“ES文本阅读器”即可查看源码。

方法三、Firefox 或 Chrome 手机浏览器

在要查看源码的网址前加“view-source:”即可。

望采纳~

最简单的用WebClient:

调用方法:string html=DownloadData("http://www.baidu.com",Encoding.GetEncoding("gb2312"))

public static string DownloadData(string url,Encoding encoding)

{

WebClient web = new WebClient()

return encoding.GetString(web.DownloadData(url))

}

复杂一点用HttpWebRequest/HttpWebResponse:

调用方法:string html=DownloadHtmlPage("http://www.baidu.com",Encoding.GetEncoding("gb2312"),"GET",20)

public static string DownloadHtmlPage(string pageUrl, Encoding encoding, string requestMethod,int timeOut)

{

string value = string.Empty

HttpWebResponse response=null

Stream data=null

StreamReader sr=null

try

{

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(pageUrl)

request.Method = requestMethod

if (timeOut != -1) request.Timeout = timeOut

response = (HttpWebResponse)request.GetResponse()

data = response.GetResponseStream()

sr = new StreamReader(data, encoding)

string str

StringBuilder source = new StringBuilder()

while ((str = sr.ReadLine()) != null)

source.Append(str).Append("\r\n")

value = source.ToString()

}

finally

{

if (sr != null) sr.Close()

if(data!=null) data.Close()

if(response!=null) response.Close()

}

return value

}

html源码?你确定所有网页文件都是HTML格式吗?如果是就不用判断了,100%没有后门。

后门代码需要可执行的动态文件页面,扩展名一般为.asp,.php等,还要你服务器开通了项服务才行。

如果你的网站里包含以上文件的话,我可以告诉你,没有简单的办法去判断它是否有后门,最简单的办法恐怕是去下载网站看看评论了,要么把网站代码发给高手门看一下。

正规的办法一行行去查看代码是否可能为后门,全部看完很费时费力,当然如果你很轻松的能看明白这些一行行的代码,你就不如自己写代码了。

当然还有“asp 木马检测工具”等辅助工具,但它们只是把包含有危险语句的文件找出来而异,但正常的网页文件也可能包含这些语句,如果还是要自己来判断。

大体情况这是这样了。