C # Software binding QQ Group class open source release

Source: Internet
Author: User

Sunday Free to write a public class, you can add to your own project restrictions must be added to your QQ group to be able to use.

Code is simple, master do not spray, there is not a reasonable place to let everyone learn to learn.

Using system;using system.text;using System.Windows.Forms; #region Call Example//checkqqqun QQ = new Checkqqqun ("306473605");//qq.        Checkresult + = new Checkqqqun.checkqun (qq_checkresult);//void Qq_checkresult (bool result)//{//if (result)//{// Authorized//}//else//{////Unauthorized//}//} #endregion///<summary>///QQ Group verification///&LT;/SUMMARY&GT;PUBL    IC partial class checkqqqun{//Creates a delegate with a return type of void, two parameters public delegate void Checkqun (bool Result);    Associates the created delegate with a specific event, where the specific event is KeyDown public event Checkqun Checkresult;    WebBrowser webBrowser1 = new WebBrowser ();    public bool Getqunlist; String Currqun = String.    Empty;        Public Checkqqqun (string number) {Currqun = number; WebBrowser1.Navigate ("http://xui.ptlogin2.qq.com/div/qlogin_div.html?flag2=3&u1=http%253A%252F%        252fqun.qzone.qq.com%252fgroup ");    webbrowser1.documentcompleted + = new Webbrowserdocumentcompletedeventhandler (webbrowser1_documentcompleted); } void WebBrowser1_documentcompleted (object sender, WebBrowserDocumentCompletedEventArgs e) {var loginbtn = webbrowser1.document.        getElementById ("loginbtn"); if (loginbtn! = null) {webBrowser1.Document.GetElementById ("loginbtn").        InvokeMember ("click"); } else {if (webBrowser1.Url.ToString (). IndexOf ("http://qun.qzone.qq.com/cgi-bin/get_group_list") = =-1) {HtmlElement qqscript = Webbro Wser1.                Document.createelement ("script"); Qqscript.                SetAttribute ("type", "Text/javascript"); Qqscript.                SetAttribute ("text", "function Getqq () {return g_iuin;}");                 WebBrowser1.Document.Body.AppendChild (Qqscript);                HtmlElement script = webBrowser1.Document.CreateElement ("script"); Script.                SetAttribute ("type", "Text/javascript"); Script.                SetAttribute ("text", "function GetToken () {return Qwt.getacsrftoken ()}"); WebBrowser1.Document.Body.AppEndchild (script); WebBrowser1.Navigate ("http://qun.qzone.qq.com/cgi-bin/get_group_list?uin=" + webBrowser1.Document.InvokeScript (" Getqq "). ToString () + "&g_tk=" + Convert.ToInt32 (webBrowser1.Document.InvokeScript ("GetToken").            ToString ()));                    } else {if (webBrowser1.DocumentText.IndexOf (Currqun)!=-1) {                    if (checkresult!=null) {Checkresult (true);                        }} else {if (checkresult! = null) {                    Checkresult (FALSE); }                }            }        }    }}

C # Software binding QQ Group class open source release

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.