public async Task <IActionResult> ChallengeRequired() { IResult <InstaChallengeRequireVerifyMethod> challenge = null; challenge = await api.GetChallengeRequireVerifyMethodAsync(); ViewBag.PhoneNumberAvailable = false; ViewBag.EmailAvailable = false; if (challenge.Succeeded) { if (challenge.Value.StepData != null) { if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { ViewBag.PhoneNumberAvailable = true; ViewBag.PhoneNumber = challenge.Value.StepData.PhoneNumber; } if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { ViewBag.EmailAvailable = true; ViewBag.Email = challenge.Value.StepData.Email; } } } else { ViewData["ErrorMessage"] = challenge.Info.Message; } return(View()); }
private async void btnBaslat_Click(object sender, EventArgs e) { try { if (btnBaslat.Text == "Durdur") { timer1.Stop(); listBox1.Items.Add("[" + DateTime.Now.ToString("HH:mm") + "]" + "Durduruldu."); btnBaslat.Text = "Başlat"; saydimmm = 0; } else { if (string.IsNullOrEmpty(txtKullaniciAdi.Text)) { MessageBox.Show("Kullanıcı Adı Boş Olamaz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(txtParola.Text)) { MessageBox.Show("Parola Boş Olamaz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(textBox2.Text)) { MessageBox.Show("URL Boş Olamaz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } user = new UserSessionData(); user.UserName = txtKullaniciAdi.Text; user.Password = txtParola.Text; api = InstaApiBuilder.CreateBuilder().SetUser(user).UseLogger(new DebugLogger(LogLevel.Exceptions)).Build(); label4.Text = "Giriş yapılıyor.."; label4.ForeColor = Color.Orange; listBox1.Items.Add("[" + DateTime.Now.ToString("HH:mm") + "]" + "Giriş yapılıyor.."); var logInResult = await api.LoginAsync(); if (logInResult.Succeeded) { label4.Text = "Giriş yapıldı."; label4.ForeColor = Color.Green; listBox1.Items.Add("[" + DateTime.Now.ToString("HH:mm") + "]" + "Giriş yapıldı."); if (await Get_Media_ID()) { Invoke((MethodInvoker) delegate { timer1.Interval = (int)numericUpDown1.Value * 1000; timer1.Start(); btnBaslat.Text = "Durdur"; }); } else { btnBaslat.Text = "Başlat"; MessageBox.Show("Media ID'si alınamadı.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } else { btnBaslat.Text = "Başlat"; label4.Text = "Giriş yapılamadı, loglara bakın."; listBox1.Items.Add("[" + DateTime.Now.ToString("HH:mm") + "]" + "Giriş yapılamadı:"); listBox1.Items.Add("[" + DateTime.Now.ToString("HH:mm") + "]" + logInResult.Info.Message); label4.ForeColor = Color.Red; if (logInResult.Value == InstaLoginResult.ChallengeRequired) { var challenge = await api.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { if (challenge.Value.SubmitPhoneRequired) { //telefon } else { if (challenge.Value.StepData != null) { if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { var pnv = challenge.Value.StepData.PhoneNumber; MessageBox.Show(pnv); sendCode(api); } if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { var emv = challenge.Value.StepData.Email; MessageBox.Show(emv); sendCode(api); } } } } else { //MessageBox.Show(challenge.Info.Message, "ERR", MessageBoxButtons.OK, MessageBoxIcon.Error); listBox1.Items.Add("[" + DateTime.Now.ToString("HH:mm") + "]" + challenge.Info.Message); } label4.Text = "Bir hata oluştu, loglara bakın."; label4.ForeColor = Color.Red; } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private async Task GetChallenge() { var currentUser = await InstaApi.LoginAsync(); if (currentUser.Succeeded) { SaveSession(); } else { if (currentUser.Value == InstaLoginResult.ChallengeRequired) { var challenge = await InstaApi.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { if (challenge.Value.SubmitPhoneRequired) { Console.WriteLine("Please type a valid phone number(with country code).\r\ni.e: +989123456789"); string phoneNumber = Console.ReadLine(); if (!phoneNumber.StartsWith("+")) { phoneNumber = $"+{phoneNumber}"; } var submitPhone = await InstaApi.SubmitPhoneNumberForChallengeRequireAsync(phoneNumber); if (submitPhone.Succeeded) { try { var phoneResult = await InstaApi.RequestVerifyCodeToSMSForChallengeRequireAsync(); if (phoneResult.Succeeded) { Console.WriteLine("We sent verify code to this phone number(it's end with this):\n" + phoneResult.Value.StepData.ContactPoint); await VerifyData(); } else { Console.WriteLine(phoneResult.Info.Message, "ERROR"); } } catch (Exception) { Console.WriteLine("Error while trying get challenge from phone number"); throw; } } else { Console.WriteLine("Error while trying get challenge from phone"); } } else { try { var email = await InstaApi.RequestVerifyCodeToEmailForChallengeRequireAsync(); if (email.Succeeded) { Console.WriteLine($"We sent verify code to this email:\n{email.Value.StepData.ContactPoint}"); await VerifyData(); } else { Console.WriteLine("Error while trying get challenge from email"); } } catch (Exception) { Console.WriteLine("Exception while trying get challenge from email"); throw; } } } else { Console.WriteLine("Error while trying get challenge"); } } else if (currentUser.Value == InstaLoginResult.TwoFactorRequired) { await TwoFactorAuth(); } } }
// Deprecated // /* * private void RunChallenge() * { * Console.WriteLine("Starting chalange auth..."); * if (proxydata.host!=null) * { * Console.WriteLine("Using proxy..."); * var p = new System.Diagnostics.Process(); * p.StartInfo.FileName = "ChallengeRequire.exe"; * p.StartInfo.Arguments = userSession.UserName +" " + userSession.Password +" "+ proxydata.host +" "+ proxydata.port +" "+ proxydata.username +" "+ proxydata.password; * p.StartInfo.RedirectStandardOutput = true; * p.StartInfo.UseShellExecute = false; * p.StartInfo.CreateNoWindow = true; * p.Start(); * } * else * { * var p = new System.Diagnostics.Process(); * p.StartInfo.FileName = "ChallengeRequire.exe"; * p.StartInfo.Arguments = userSession.UserName + " " + userSession.Password; * p.StartInfo.RedirectStandardOutput = true; * p.StartInfo.UseShellExecute = false; * p.StartInfo.CreateNoWindow = true; * p.Start(); * } * Console.WriteLine("Press 1 if challenge is created"); * Console.WriteLine("Press 2 to exit"); * * var key = Console.ReadLine(); * Console.WriteLine(Environment.NewLine); * int answer = Convert.ToInt32(key); * if (answer != 1) * { * Console.WriteLine("Error"); * return; * } * } */ private async Task GetChallenge() { var currentUser = await InstaApi.LoginAsync(); if (currentUser.Succeeded) { SaveSession(); } else { if (currentUser.Value == InstaLoginResult.ChallengeRequired) { var challenge = await InstaApi.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { if (challenge.Value.SubmitPhoneRequired) { Console.WriteLine("Please type a valid phone number(with country code).\r\ni.e: +989123456789"); string phoneNumber = Console.ReadLine(); if (!phoneNumber.StartsWith("+")) { phoneNumber = $"+{phoneNumber}"; } var submitPhone = await InstaApi.SubmitPhoneNumberForChallengeRequireAsync(phoneNumber); if (submitPhone.Succeeded) { try { var phoneResult = await InstaApi.RequestVerifyCodeToSMSForChallengeRequireAsync(); if (phoneResult.Succeeded) { Console.WriteLine("We sent verify code to this phone number(it's end with this):\n" + phoneResult.Value.StepData.ContactPoint); await VerifyData(); } else { Console.WriteLine(ErrorsContract.ACC_CH_PHONE_CONFIRM + phoneResult.Info.Message); ExceptionUtils.Throw(Error.E_CHALLENGE, ErrorsContract.ACC_CH_PHONE_CONFIRM + phoneResult.Info.Message); } } catch (Exception ex) { Console.WriteLine(ErrorsContract.ACC_CH_PHONE_ERROR + ex); ExceptionUtils.Throw(Error.E_CHALLENGE, ErrorsContract.ACC_CH_PHONE_ERROR + ex.Message); } } else { Console.WriteLine(ErrorsContract.ACC_CH_PHONE_ERROR + submitPhone.Info.Message); ExceptionUtils.Throw(Error.E_CHALLENGE, ErrorsContract.ACC_CH_PHONE_ERROR + submitPhone.Info.Message); } } else { try { var email = await InstaApi.RequestVerifyCodeToEmailForChallengeRequireAsync(); if (email.Succeeded) { Console.WriteLine($"We sent verify code to this email:\n{email.Value.StepData.ContactPoint}"); await VerifyData(); } else { Console.WriteLine(ErrorsContract.ACC_CH_EMAIL_CONFIRM_CODE + email.Info.Message); ExceptionUtils.Throw(Error.E_CHALLENGE, ErrorsContract.ACC_CH_EMAIL_CONFIRM_CODE + email.Info.Message); } } catch (Exception ex) { Console.WriteLine(ErrorsContract.ACC_CH_EMAIL_CONFIRM_EX + ex); ExceptionUtils.Throw(Error.E_CHALLENGE, ErrorsContract.ACC_CH_EMAIL_CONFIRM_EX + ex.Message); } } } else { Console.WriteLine(ErrorsContract.ACC_CH_EMAIL_CONFIRM_FAIL); ExceptionUtils.Throw(Error.E_CHALLENGE, ErrorsContract.ACC_CH_EMAIL_CONFIRM_FAIL); } } else if (currentUser.Value == InstaLoginResult.TwoFactorRequired) { await TwoFactorAuth(); } } }
private async void LoginButton_Click(object sender, EventArgs e) { Size = NormalSize; var userSession = new UserSessionData { UserName = txtUser.Text, Password = txtPass.Text }; InstaApi = InstaApiBuilder.CreateBuilder() .SetUser(userSession) .UseLogger(new DebugLogger(LogLevel.Exceptions)) .SetRequestDelay(RequestDelay.FromSeconds(0, 1)) .Build(); Text = $"{AppName} Connecting"; try { if (File.Exists(StateFile)) { Debug.WriteLine("Loading state from file"); using (var fs = File.OpenRead(StateFile)) { InstaApi.LoadStateDataFromStream(fs); } } } catch (Exception ex) { Debug.WriteLine(ex); } if (!InstaApi.IsUserAuthenticated) { var logInResult = await InstaApi.LoginAsync(); Debug.WriteLine(logInResult.Value); if (logInResult.Succeeded) { GetFeedButton.Visible = true; Text = $"{AppName} Connected"; // Save session SaveSession(); } else { if (logInResult.Value == InstaLoginResult.ChallengeRequired) { var challenge = await InstaApi.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { if (challenge.Value.StepData != null) { if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { RadioVerifyWithPhoneNumber.Checked = false; RadioVerifyWithPhoneNumber.Visible = true; RadioVerifyWithPhoneNumber.Text = challenge.Value.StepData.PhoneNumber; } if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { RadioVerifyWithEmail.Checked = false; RadioVerifyWithEmail.Visible = true; RadioVerifyWithEmail.Text = challenge.Value.StepData.Email; } SelectMethodGroupBox.Visible = true; Size = ChallengeSize; } } else { MessageBox.Show(challenge.Info.Message, "ERR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } else { Text = $"{AppName} Connected"; GetFeedButton.Visible = true; } }
private async void loginButton_Click(object sender, EventArgs e) { string username = botPhoneTextBox.Text; string password = botPasswordTextBox.Text; var userSession = new UserSessionData { UserName = username, Password = password }; instaApi = InstaApiBuilder.CreateBuilder() .UseLogger(new DebugLogger(LogLevel.All)) .SetRequestDelay(RequestDelay.FromSeconds(0, 3)) .SetSessionHandler(new FileSessionHandler() { FilePath = "sessions\\session_" + username + ".bin" }) .SetUser(userSession) .Build(); // Load session LoadSession(); if (!instaApi.GetLoggedUser().Password.Equals(password) && instaApi.IsUserAuthenticated) { MessageBox.Show("Wrong password", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (instaApi.IsUserAuthenticated) { this.Visible = false; MainForm mainForm = new MainForm(ref instaApi); mainForm.Show(); //this.Close(); } else { var logInResult = await instaApi.LoginAsync(); if (logInResult.Succeeded) { SaveSession(); this.Visible = false; MainForm mainForm = new MainForm(ref instaApi); mainForm.Show(); //this.Close(); } else { if (logInResult.Value == InstaLoginResult.ChallengeRequired) { var challenge = await instaApi.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { if (challenge.Value.SubmitPhoneRequired) { submitPhoneNumberPanel.Enabled = true; submitPhoneNumberPanel.Visible = true; } else { if (challenge.Value.StepData != null) { if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { phoneChallengeRadio.Checked = false; phoneChallengeRadio.Visible = true; phoneChallengeRadio.Text = challenge.Value.StepData.PhoneNumber; } if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { emailChallengeRadio.Checked = false; emailChallengeRadio.Visible = true; emailChallengeRadio.Text = challenge.Value.StepData.Email; } challengeRequiredPanel.Enabled = true; challengeRequiredPanel.Visible = true; } } } else { MessageBox.Show(challenge.Info.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } // Two factor is required else if (logInResult.Value == InstaLoginResult.TwoFactorRequired) { // Open a panel so user can send two factor code twoFAPanel.Visible = true; twoFAPanel.Enabled = true; loginPanel.Enabled = false; } else { MessageBox.Show(logInResult.Value.ToString(), "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private async void LoginButton_Click(object sender, EventArgs e) { Size = NormalSize; var userSession = new UserSessionData { UserName = txtUser.Text, Password = txtPass.Text }; InstaApi = InstaApiBuilder.CreateBuilder() .SetUser(userSession) .UseLogger(new DebugLogger(LogLevel.All)) .SetRequestDelay(RequestDelay.FromSeconds(0, 1)) // Session handler, set a file path to save/load your state/session data .SetSessionHandler(new FileSessionHandler() { FilePath = StateFile }) .Build(); Text = $"{AppName} Connecting"; //Load session LoadSession(); if (!InstaApi.IsUserAuthenticated) { var logInResult = await InstaApi.LoginAsync(); Debug.WriteLine(logInResult.Value); if (logInResult.Succeeded) { GetFeedButton.Visible = true; Text = $"{AppName} Connected"; // Save session SaveSession(); } else { if (logInResult.Value == InstaLoginResult.ChallengeRequired) { var challenge = await InstaApi.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { if (challenge.Value.SubmitPhoneRequired) { SubmitPhoneChallengeGroup.Visible = true; Size = ChallengeSize; } else { if (challenge.Value.StepData != null) { if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { RadioVerifyWithPhoneNumber.Checked = false; RadioVerifyWithPhoneNumber.Visible = true; RadioVerifyWithPhoneNumber.Text = challenge.Value.StepData.PhoneNumber; } if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { RadioVerifyWithEmail.Checked = false; RadioVerifyWithEmail.Visible = true; RadioVerifyWithEmail.Text = challenge.Value.StepData.Email; } SelectMethodGroupBox.Visible = true; Size = ChallengeSize; } } } else { MessageBox.Show(challenge.Info.Message, "ERR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else if (logInResult.Value == InstaLoginResult.TwoFactorRequired) { TwoFactorGroupBox.Visible = true; Size = ChallengeSize; } } } else { Text = $"{AppName} Connected"; GetFeedButton.Visible = true; } }
private async void LoginButton_Click(object sender, EventArgs e) { Size = NormalSize; lblError.Text = ""; InstaApi = Helper.InstaApi.GetInstaApi(txtUser.Text, txtPass.Text); Text = $"{_userName} Connecting"; if (!InstaApi.IsUserAuthenticated) { var logInResult = await InstaApi.LoginAsync(); Debug.WriteLine(logInResult.Value); if (logInResult.Succeeded) { GetFeedButton.Visible = true; Text = $"{_userName} Connected"; // Save session SaveSession(); _callback(new InstaApiInstance { Api = InstaApi, Account = _userName }); } else { if (logInResult.Value == InstaLoginResult.ChallengeRequired) { var challenge = await InstaApi.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { if (challenge.Value.SubmitPhoneRequired) { SubmitPhoneChallengeGroup.Visible = true; Size = ChallengeSize; } else { if (challenge.Value.StepData != null) { if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { RadioVerifyWithPhoneNumber.Checked = false; RadioVerifyWithPhoneNumber.Visible = true; RadioVerifyWithPhoneNumber.Text = challenge.Value.StepData.PhoneNumber; } if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { RadioVerifyWithEmail.Checked = false; RadioVerifyWithEmail.Visible = true; RadioVerifyWithEmail.Text = challenge.Value.StepData.Email; } SelectMethodGroupBox.Visible = true; Size = ChallengeSize; } } } else { MessageBox.Show(challenge.Info.Message, "ERR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else if (logInResult.Value == InstaLoginResult.TwoFactorRequired) { TwoFactorGroupBox.Visible = true; Size = ChallengeSize; } else { lblError.Text = logInResult.Value.ToString(); } } } else { Text = $"{_userName} Connected"; GetFeedButton.Visible = true; } }
public async void LoginUser() { Log("***Login***User***"); if (/*!instaApi.IsUserAuthenticated*/ true) { Log("User is not Authentificated"); var logInResult = await instaApi.LoginAsync(); if (logInResult.Succeeded) { Log("Login result is SUCCESS"); // Save session SaveSession(); } else { Log("Login result is FAIL"); if (logInResult.Value == InstaLoginResult.ChallengeRequired) { Log("Need verify Require challenge"); var challenge = await instaApi.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { Log("Challenge start!"); if (challenge.Value.SubmitPhoneRequired) { Log("Submit Phone"); } else { Log("Not submit phone"); if (challenge.Value.StepData != null) { Log("Try get phone or email adress"); if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { Log("Phone adress!"); Adress.Text = challenge.Value.StepData.PhoneNumber; } if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { isEmail = true; Log("Email adress!"); Adress.Text = challenge.Value.StepData.Email; } } } } else { Log("Challenge ERROR"); } } else if (logInResult.Value == InstaLoginResult.TwoFactorRequired) { Log("2 factor required"); } } } else { Log("You are already Authentificated"); } }
private async void btnBaslat_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtKullaniciAdi.Text)) { MessageBox.Show("Kullanıcı Adı Boş Olamaz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(txtParola.Text)) { MessageBox.Show("Parola Boş Olamaz!", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } user = new UserSessionData(); user.UserName = txtKullaniciAdi.Text; user.Password = txtParola.Text; api = InstaApiBuilder.CreateBuilder().SetUser(user).UseLogger(new DebugLogger(LogLevel.Exceptions)).Build(); var logInResult = await api.LoginAsync(); if (logInResult.Succeeded) { timer1.Start(); } else { if (logInResult.Value == InstaLoginResult.ChallengeRequired) { var challenge = await api.GetChallengeRequireVerifyMethodAsync(); if (challenge.Succeeded) { if (challenge.Value.SubmitPhoneRequired) { //telefon } else { if (challenge.Value.StepData != null) { if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { var pnv = challenge.Value.StepData.PhoneNumber; MessageBox.Show(pnv); sendCode(api); } if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { var emv = challenge.Value.StepData.Email; MessageBox.Show(emv); sendCode(api); } } } } else { MessageBox.Show(challenge.Info.Message, "ERR", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// Instagram Giriş Yap Butonu /// </summary> private async void Button_InstaGiris_Click(object sender, EventArgs e) { // Kutucuklar boşsa durrr if (textBox_InstaGiris_kadi.Text == "" || textBox_InstaGiris_sifre.Text == "") { // Bilgi Mesajı BilgiMesaji("bilgi", "Bütün alanları doldurmalısınız.", this.Text, true); } else { // Bilgi Mesajı BilgiMesaji("bilgi", "Giriş yapılıyor, bekleyin.", this.Text, false); label_Insta_GirisDurum.Text = "Giriş yapılıyor, bekleyin."; InstaGirisAktif(); // Dosya yolu string StateKlasor = Yol_Kullanicilar + textBox_InstaGiris_kadi.Text + @"\"; c_SabitKodlar.Klasor_Kontrol(StateKlasor); string StateYol = StateKlasor + OturumDosyasi; if (File.Exists(StateYol)) { File.Delete(StateYol); } // Kullanıcı oturumları var userSession = new UserSessionData { UserName = textBox_InstaGiris_kadi.Text, Password = textBox_InstaGiris_sifre.Text }; // Oturum oluşturma InstaApi = InstaApiBuilder.CreateBuilder() .SetUser(userSession) .SetRequestDelay(RequestDelay.FromSeconds(0, 1)) .SetSessionHandler(new FileSessionHandler() { FilePath = StateYol }) .Build(); OturumYukle(); //MessageBox.Show(InstaApi.IsUserAuthenticated.ToString()); // Giriş Kontrolü if (InstaApi.IsUserAuthenticated) { // Başarılı // Bilgi Mesajı BilgiMesaji("basarili", "Giriş yapıldı.", this.Text, false); label_Insta_GirisDurum.Text = "Giriş yapıldı."; InstaGirisAktif(); } else { // Başarısız // Giriş çıktısı var girisCiktisi = await InstaApi.LoginAsync(); string donenVeri = girisCiktisi.Value.ToString(); /*MessageBox.Show(girisCiktisi.Info.Message); * MessageBox.Show(donenVeri);*/ // Kullanıcı Bilgileri Hatalı if (donenVeri == "BadPassword" || donenVeri == "InvalidUser") { // Bilgi Mesajı BilgiMesaji("hata", "Kullanıcı bilgileriniz hatalı.", this.Text, true); label_Insta_GirisDurum.Text = "Kullanıcı bilgileriniz hatalı."; InstaGirisPasif(); } // Hesap Banlı else if (donenVeri == "InactiveUser") { // Bilgi Mesajı BilgiMesaji("hata", "Hesap Instagram tarafından kapatılmış.", this.Text, true); label_Insta_GirisDurum.Text = "Hesap Instagram tarafından kapatılmış."; InstaGirisPasif(); } // Hesap Askıda else if (girisCiktisi.Info.Message == "Sorry, there was a problem with your request.") { // Bilgi Mesajı BilgiMesaji("hata", "Lütfen tekrar denemeden önce birkaç dakika bekleyin.", this.Text, true); label_Insta_GirisDurum.Text = "Lütfen tekrar denemeden önce birkaç dakika bekleyin."; InstaGirisPasif(); } // Giriş başarılı mı? else if (girisCiktisi.Succeeded) { // Bilgi Mesajı BilgiMesaji("basarili", "Giriş yapıldı.", this.Text, false); label_Insta_GirisDurum.Text = "Giriş yapıldı."; tab_Sekmeler.SelectedTab = tab_Sayfa; InstaGirisAktif(); OturumKaydet(); } // Diğer Giriş Yöntemleri else { // 1- Doğrulama Gereken Hesap if (girisCiktisi.Value == InstaLoginResult.ChallengeRequired) { // Doğrulama işlemi var challenge = await InstaApi.GetChallengeRequireVerifyMethodAsync(); // Doğrulama Başarılı mı? if (!challenge.Succeeded) { // Başarısız // Bilgi Mesajı BilgiMesaji("hata", "Hesap doğrulama başarısız.", this.Text, true); label_Insta_GirisDurum.Text = "Hesap doğrulama başarısız."; InstaGirisPasif(); } else { // Başarılı // Telefon numarası girme if (challenge.Value.SubmitPhoneRequired) { // Bilgi Mesajı BilgiMesaji("bilgi", "Hesaba telefon numarası girmelisiniz.", this.Text, true); label_Insta_GirisDurum.Text = "Hesaba telefon numarası girmelisiniz."; panel_InstaGiris.Visible = false; group_Insta_TelefonGirme.Dock = DockStyle.Fill; group_Insta_TelefonGirme.Visible = true; } else { // Parametreler boş değilse if (challenge.Value.StepData != null) { // Telefon if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber)) { radio_Insta_TelefonDogrulama.Checked = false; radio_Insta_TelefonDogrulama.Visible = true; radio_Insta_TelefonDogrulama.Text = challenge.Value.StepData.PhoneNumber; } // Eposta if (!string.IsNullOrEmpty(challenge.Value.StepData.Email)) { radio_Insta_EpostaDogrulama.Checked = false; radio_Insta_EpostaDogrulama.Visible = true; radio_Insta_EpostaDogrulama.Text = challenge.Value.StepData.Email; } panel_InstaGiris.Visible = false; group_Insta_HesapDogrulama.Dock = DockStyle.Fill; group_Insta_HesapDogrulama.Visible = true; } } } // end if: doğrulama } // 2- İki Faktörlü doğrulama else if (girisCiktisi.Value == InstaLoginResult.TwoFactorRequired) { panel_InstaGiris.Visible = false; group_IkiFaktorluDogrulama.Dock = DockStyle.Fill; group_IkiFaktorluDogrulama.Visible = true; } } } // END IF: Giriş kontrolü } // END IF: Kutucuklar boşsa }