In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "how asp.net collects all the image and picture resources on the page". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to collect all the image and picture resources on the page by asp.net".
/ / download all the pictures under the specified URL / public class WebPageImage {/ get all the pictures in the web page / web address / web page code, empty automatic judgment / all pictures display code public string getImages (string url, string charSet) {string s = getHtml (url, charSet) Return getPictures (s, url);} / URL / all images code public string getImages (string url) {return getImages (url, ");} string doman (string url) {Uri u = new Uri (url); return u.Host } / obtain the encoding of the web page / website address / the encoding of the target web page. If null or "" is passed in, the encoding of the web page / string getHtml (string url, string charSet) {WebClient myWebClient = new WebClient () is automatically analyzed. / / create WebClient instance myWebClient / / Note: / / whether some web pages may come down, there are various reasons, such as the need for cookie, coding problems, etc. / / this requires specific analysis of specific problems, such as adding cookie / / webclient.Headers.Add ("Cookie", cookie) in the header; / / this may require some overloading methods. Just write as needed / / get or set the network credentials used to authenticate requests to Internet resources. MyWebClient.Credentials = CredentialCache.DefaultCredentials; / / if the server wants to verify the user name, the password / / NetworkCredential mycred = new NetworkCredential (struser, strpassword); / / myWebClient.Credentials = mycred; / / downloads data from the resource and returns a byte array. (add @ because there is a "/" symbol in the middle of the URL) byte [] myDataBuffer = myWebClient.DownloadData (url); string strWebData = Encoding.Default.GetString (myDataBuffer); / / get the page character encoding description information Match charSetMatch = Regex.Match (strWebData, "
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.