منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : تسجيل الدخول للفيس بوك من خلال HttpWebRequest
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
الصفحات : 1 2
هل من طريقه من استخراج الاكسس توكن عن طريق برنامجي ؟
و بالطبع بعد تسجيل الحساب

(19-05-18, 07:18 PM)mrnooo2000 كتب : [ -> ]جرب هذه الدالة ربما تكون أسرع 


كود :
   Sub login(ByVal email As String, ByVal password As String)
       If email = String.Empty AndAlso password = String.Empty Then
           MsgBox("Put your email & password", 0, "Input data")
       Else
           Dim postData As String = "email=" & email & "&pass=" & password & ""
           Dim tempcookies As New CookieContainer
           Dim encoding As New UTF8Encoding
           Dim byteData As Byte() = encoding.GetBytes(postData)
           Dim postreq As HttpWebRequest = DirectCast(HttpWebRequest.Create("https://www.facebook.com/login.php?iphone&next=http%3A%2F%2Ftouch.facebook.com%2Findex.php%3Feu%3DD0sS06p7LA4Jn5QzzqNH​Qg&refsrc=http%3A%2F%2Ftouch.facebook.com%2F"), HttpWebRequest)
           postreq.Method = "POST"
           postreq.KeepAlive = True
           postreq.CookieContainer = tempcookies
           postreq.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b6pre) Gecko/20100903 Firefox/4.0b6pre"
           postreq.ContentType = "application/x-www-form-urlencoded"
           postreq.Referer = "https://www.facebook.com/campaign/landing.php?&campaign_id=416642168442271&extra_1=s%7Cc%7C252977459990%7Cb%7Cfeas%20book%7C&placement=&creative=252977459990&keyword=feas%20book&partner_id=googlesem&extra_2=campaignid%3D160380079%26adgroupid%3D8949273799%26matchtype%3Db%26network%3Dg%26source%3Dnotmobile%26search_or_content%3Ds%26device%3Dc%26devicemodel%3D%26adposition%3D1o2%26target%3D%26targetid%3Dkwd-6653405681%26loc_physical_ms%3D9073644%26loc_interest_ms%3D%26feeditemid%3D%26param1%3D%26param2%3D&gclid=EAIaIQobChMIk-ikvq6P2wIVCt0bCh07bg1MEAMYAiAAEgK5NfD_BwE"
           ' postreq.Referer = "http://touch.facebook.com/login.php?next=http%3A%2F%2Ftouch.facebook.com%2Findex.php%3Feu%3DD0sS06p7LA4Jn5​QzzqNHQg&refsrc=http%3A%2F%2Ftouch.facebook.com%2F&_rdr"
           postreq.ContentLength = byteData.Length
           Dim postreqstream As Stream = postreq.GetRequestStream()
           postreqstream.Write(byteData, 0, byteData.Length)
           postreqstream.Close()
           Dim postresponse As HttpWebResponse
           postresponse = DirectCast(postreq.GetResponse, HttpWebResponse)
           tempcookies.Add(postresponse.Cookies)
           logincookie = tempcookies
           Dim postreqreader As New StreamReader(postresponse.GetResponseStream())
           Dim thepage As String = postreqreader.ReadToEnd

           If thepage.Contains("Incorrect email/password combination") = True Then
               MsgBox("Incorrect email/password combination", 0, "Login error!")
           Else
               MsgBox("Logged in", 0, "Success!")
           End If
           If thepage.Contains("You have exceeded the number of invalid login attempts that we allow for your account") = True Then
               MsgBox("You have exceeded the number of invalid login attempts", 0, "Max number of wrong logins")
           End If
       End If
   End Sub
و ما فائده هذا الكود و احتاج شرح له ..
الصفحات : 1 2