Beispiel #1
0
        public Boolean LoginOut()
        {
            string response = DownloadString("https://m.facebook.com/");

            HtmEle.LoadHtml(response);

            //If HtmEle.DocumentNode.SelectNodes("//table//tr") Is Nothing Then Return False
            if (HtmEle.DocumentNode.SelectNodes("//a") is null)
            {
                return(false);
            }

            foreach (HtmlNode element in HtmEle.DocumentNode.SelectNodes("//a"))
            {
                if (element.InnerText.Contains("登出"))
                {
                    string url = element.GetAttributeValue("href", "false");
                    if (url != "false")
                    {
                        url      = "https://m.facebook.com" + UrlTransfer(url);
                        response = DownloadString(url);
                    }
                    break;
                }
            }
            CookieContainer = new System.Net.CookieContainer();
            return(false);
        }
Beispiel #2
0
        public List <string> GetGroupList()
        {
            string response = DownloadString("https://m.facebook.com/groups/?seemore&refid=27");

            HtmEle.LoadHtml(response);

            List <string> tempList = new List <string>();
            string        temp;
            Regex         regex = new Regex("/groups/(\\d+).refid=27");

            foreach (HtmlNode element in HtmEle.DocumentNode.SelectNodes("//a"))
            {
                temp = element.GetAttributeValue("href", "fasle");

                if (regex.IsMatch(temp))
                {
                    tempList.Add(regex.Match(temp).Groups[1].Value);
                }
            }

            return(tempList);
        }