NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

selenium.support
selenium.webdriver
selenium.webdriver.chromedriver


Imports OpenQA.Selenium
Imports OpenQA.Selenium.Chrome
Imports System.IO
Imports System.Net.Mail
Public Class FullCacheDelete
Dim driver As IWebDriver
Dim options As ChromeOptions = New ChromeOptions()
Dim saniye As Integer
Dim mailSonuc, mailadresleri, mailbodytxt As String

Private Sub Button_Delete_Click(sender As Object, e As EventArgs) Handles Button_Delete.Click
Dim ans As String
ans = MsgBox("Emin misiniz ?", vbYesNo,)
If ans = vbYes Then
ComboBox_Ortam.Enabled = False
Button_Delete.Enabled = False
Button_Delete.Text = "Çalışıyor.."
Fullcachesil()
End If
End Sub

Sub Gecikme(saniye)
Dim t As DateTime
If (saniye >= 1) Then
t = DateTime.Now.AddSeconds(CDbl(saniye))
While (DateTime.Now < t)
Application.DoEvents()
End While
End If
End Sub

Sub Fullcachesil()
options.AddArguments("--headless")
Dim cpcodeis(2) As String
If ComboBox_Ortam.SelectedItem.ToString() = "S1" Then
cpcodeis(0) = "1178203" 'arcelik.com.tr
cpcodeis(1) = "1178212" 'beko.com.tr
Else
cpcodeis(0) = "699918" 'arcelik.com.tr
cpcodeis(1) = "814519" 'beko.com.tr
End If

Try
Dim ChromeDriverService1 = ChromeDriverService.CreateDefaultService()
ChromeDriverService1.HideCommandPromptWindow = True
driver = New ChromeDriver(ChromeDriverService1, options)
driver.Manage().Window().Maximize()
driver.Navigate().GoToUrl("https://control.akamai.com/apps/fast-purge/#/ccu-main")
Gecikme(10)
driver.FindElement(By.Name("username")).SendKeys("[email protected]")
Gecikme(2)
Dim nextbuttonPath As String = "/html/body/div[2]/div/ui-view/ui-view/div/div[2]/form/div/ui-view/div[3]/button"
driver.FindElement(By.XPath(nextbuttonPath)).Click()
Gecikme(2)
driver.FindElement(By.Name("password")).SendKeys("@rc3l1k@dmin?4")
Gecikme(2)
Dim signinbuttonPath As String = "/html/body/div[2]/div/ui-view/ui-view/div/div[2]/form/div/ui-view/div[3]/button[1]"
driver.FindElement(By.XPath(signinbuttonPath)).Click()
Gecikme(3)
Try
Dim skipbuttonPath As String = "button[class='acc-forward-btn pull-right-content btn spinner-button ng-isolate-scope btn-primary']"
driver.FindElement(By.CssSelector(skipbuttonPath)).Click()
Catch ex As Exception
End Try
Gecikme(8)
Dim urlbyCpcode As String = "/html/body/div/div/ui-view/div[2]/form/div/div[1]/div[2]/div/label"
driver.FindElement(By.XPath(urlbyCpcode)).Click()
Gecikme(2)
driver.FindElement(By.XPath("/html/body/div/div/ui-view/div[2]/form/div/div[3]/div[2]/div/div/div/div/span/input")).SendKeys(cpcodeis(0))
Gecikme(1)
driver.FindElement(By.XPath("/html/body/div/div/ui-view/div[2]/form/div/div[3]/div[2]/div/div/div/div/div[1]/div/table/thead/tr/th[1]/span/label")).Click()
Gecikme(1)
driver.FindElement(By.CssSelector("i[class='aci-close clear-filter icon-states util-clickable ng-scope']")).Click()
Gecikme(1)
driver.FindElement(By.XPath("/html/body/div/div/ui-view/div[2]/form/div/div[3]/div[2]/div/div/div/div/span/input")).SendKeys(cpcodeis(1))
Gecikme(1)
driver.FindElement(By.XPath("/html/body/div/div/ui-view/div[2]/form/div/div[3]/div[2]/div/div/div/div/div[1]/div/table/thead/tr/th[1]/span/label")).Click()
Gecikme(1)
Dim submitbuttonPath1 As String = "/html/body/div/div/ui-view/div[2]/form/div/div[7]/div[2]/button"
driver.FindElement(By.XPath(submitbuttonPath1)).Click()
Gecikme(3)
Dim kontrolmsj As String = ""
Try
kontrolmsj = driver.FindElement(By.CssSelector("span[ng-if='!statusMessage.givenTemplate()']")).GetAttribute("textContent")
Catch ex As Exception
End Try
Dim accept As String = "The purge request was accepted and will be completed within approximately 5 seconds"
Dim kontrolmsjS() As String = Split(kontrolmsj, ".")
kontrolmsj = kontrolmsjS(0)

If kontrolmsj = accept Then
mailSonuc = "Ok"
Else
mailSonuc = "Error"
End If
driver.Quit()

MsgBox("Cache silme sonucu : " & mailSonuc, MsgBoxStyle.Information, "Sonuç")

Catch ex As Exception
MsgBox("İşlemde hata gerçekleşmiştir.." & vbCrLf & "([email protected]'a ulaşınız.)", MsgBoxStyle.Critical, "Hata")
'MsgBox(ex.Message.ToString())
Try
If Process.GetProcessesByName("chromedriver").Count > 0 Then
Dim xlp() As Process = Process.GetProcessesByName("chromedriver")
For Each Process As Process In xlp
Process.Kill()
If Process.GetProcessesByName("chromedriver").Count = 0 Then
Exit For
End If
Next
Else
Application.Exit()
End If
Catch ex1 As Exception
Application.Exit()
End Try
End Try

Gecikme(3)
SendMail()

ComboBox_Ortam.Enabled = True
Button_Delete.Enabled = True
Button_Delete.Text = "Cache Sil"
End Sub

Sub SendMail()
mailadresleri = Form1.usermail & ",[email protected]"
mailbodytxt = "Ortam : " & ComboBox_Ortam.SelectedItem.ToString() & vbCrLf & "Kullanıcı : " & Form1.Label_userinfo.Text & vbCrLf & "Fullcache Invalid Durumu : " & mailSonuc
Try
Dim Smtp_Server As New SmtpClient
Dim e_mail As New MailMessage()
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New Net.NetworkCredential("[email protected]", "ckkp3ryyX.")
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = False
Smtp_Server.Host = "mail.ugurcanpalasoglu.com"
e_mail = New MailMessage()
e_mail.From = New MailAddress("[email protected]")
e_mail.To.Add(mailadresleri)
e_mail.Subject = "Fullcache Invalid Results - " & DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")
e_mail.IsBodyHtml = True
e_mail.Body = mailbodytxt
Smtp_Server.Send(e_mail)
Catch ex As Exception
MsgBox("Mail sending error. - " & ex.Message.ToString(), MsgBoxStyle.Critical, "Error")
End Try
End Sub

Private Sub Form_Closed(sender As Object, e As EventArgs) Handles Me.Closed
Me.Hide()
Form1.Show()
End Sub
End Class
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.