• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell (nivel medio)
  • Libro de PowerShell (nivel avanzado)
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Ver mediante una lista de botones en un formulario de PowerShell las categorías de una página en WordPress

PowerShell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$buttons_functionslist=@(
    $json=(Invoke-WebRequest -Uri 'https://www.jesusninoc.com/wp-json/wp/v2/categories').content | ConvertFrom-JSON
    $json.name
)
 
$buttons_functionbuttoncount = $buttons_functionslist.count
 
$loop = 0
 
#Formulario
$Form = New-Object System.Windows.Forms.Form
$Form.Text="Formulario"
$Form.Size=New-Object System.Drawing.Size(500,500)
$Form.StartPosition="CenterScreen"
 
while($loop -lt $buttons_functionbuttoncount)
{
$thisbutton = New-Object System.Windows.Forms.Button
[string]$thisbuttonname = $buttons_functionslist[$loop]
$thisbutton.Text = $thisbuttonname
$thisbutton.size = New-Object System.Drawing.Size(100,20)
$thisbutton.Location = New-Object System.Drawing.Size(200,(20*$loop+1))
$thisbutton.Add_Click({
        Write-Host $this.Text
})
$Form.Controls.Add($thisbutton)
$loop += 1
}
 
$Form.ShowDialog()

Publicado el día 17 de junio de 2019

CATEGORÍAS

PowerShell, Web, Web scraping

ETIQUETAS

Bot, Center, ConvertFrom-JSON, Drawing, Function, HTTP, HTTPS, Invoke-WebRequest, Jesús Niño, Jesús Niño Camazón, JSON, Log, New-Object, RDP, Screen, showdialog, size, System.Drawing, System.Windows.Forms, System.Windows.Forms.Form, Windows, Windows.Forms.Form, Word, WordPress, Write-Host

MÁS

  • Buscar el nombre de una clase de un formulario en PowerShell con Microsoft Spy++
  • Crear formulario dentro de otro formulario mediante una función con PowerShell
  • Buscar el nombre de una clase de un formulario en PowerShell con Microsoft Spy++ y escribir un mensaje en una caja de texto sin conocer el identificador de ventana en concreto del proceso…
  • Crear una aplicación gráfica en PowerShell que represente un piano (con las notas del DO a SI) y que suene cada nota
  • Ejercicios de PowerShell: crear un interfaz simple que realice la operación de suma, resta y multiplicación
  • Ejercicios de PowerShell: realizar operaciones en un equipo remoto
Jesusninoc utiliza cookies: saber más aquí.