Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - benito

Páginas: [1]
1
Visual Basic 6 / Re:como leer los option button en archivo secuencial
« en: Mayo 16, 2024, 03:43:51 pm »
cambia el evento Command5_Click por este código  :)

Código: [Seleccionar]

Private Sub Command5_Click()

Dim F_check1, F_check2, F_check3, F_check4 As Integer


cd1.InitDir = App.Path & "\fichero estudiante\"
    cd1.ShowOpen

Open cd1.Filename For Input As #1


Do While EOF(1) <> -1
   
   Input #1, mat, nom, postnom, F_check1, F_check2, sexe, F_check3, F_check4, price, datenaiss, adresse

   Text1 = mat
   Text2 = nom
   Text3 = postnom
   Text4 = datenaiss
   Text5 = adresse
   
   If CBool(F_check1) = True Then
      Option1(0).value = True
   Else
      Option1(1).value = True
   End If
   
   'If Option1(index).value = True Then
   '   Option1(0).Caption = F_check1
   '   Text6.Text = sexe
   'Else
   '   Option1(1).Caption = F_check2
   '   Text6.Text = sexe
   'End If
   
   Text6.Text = sexe

   If CBool(F_check3) = True Then
      Option2(0).value = True
   Else
      Option2(1).value = True
   End If
   
   'If Option2(index).value = True Then
   '   Option2(0).Caption = F_check3
   'Else
   '   Option2(1).Caption = F_check4
   'End If

   Text7.Text = price

Loop

Close #1

End Sub

2
Poner en un formulario un commandbutton

Código: [Seleccionar]

Option Explicit


'curl -X POST https://reqbin.com/echo/post/json
'   -H 'Content-Type: application/json'
'   -d '{"login":"my_login","password":"my_password"}'

Private Sub Command1_Click()

Dim bvData() As Byte
Dim nFile As Integer
Dim cFile As String

Dim cUrl As String
Dim cData As String

Dim i As Long
Dim c As String

cUrl = "https://reqbin.com/echo/post/json"

cData = "{[cc]login[cc]:[cc]my_login[cc],[cc]password[cc]:[cc]my_password[cc]}"
cData = Replace(cData, "[cc]", Chr(34))

With CreateObject("WinHttp.WinHttpRequest.5.1")

     .Open "POST", cUrl, False
     .send cData

     Debug.Print ("OK" = .StatusText)
     
     nFile = FreeFile
     cFile = App.Path & "\data.json"
     
     Open cFile For Binary Access Write As #nFile
     bvData() = .responsebody
     Put #nFile, , bvData()
     Close #nFile

     c = ""
     
     For i = 0 To UBound(bvData)
         c = c & Chr(bvData(i))
     Next
     
     Debug.Print c
     
End With

End Sub





JsonBag Class

https://www.vbforums.com/showthread.php?738845-VB6-JsonBag-Another-JSON-Parser-Generator&highlight=jsonbag+class


Online REST & SOAP API Testing Tool

https://reqbin.com/


Para probar endpoint puedes usar Postman

https://www.postman.com/downloads/

3
debes activar la verificación en 2 pasos, y luego generar contraseña para aplicación, en tu aplicación debes reemplazar tu contraseña por la contraseña generada...

en este hilo se explica como hacerlo

https://www.lawebdelprogramador.com/foros/Visual-Basic.NET/2139722-envio-de-correo-por-codigo-vb.net.html

https://www.youtube.com/watch?v=rlhtIz_Xl9g


Páginas: [1]