Portal    Foro    Buscar    FAQ    Registrarse    Conectarse


Publicar nuevo tema  Responder al tema 
Página 2 de 2
Ir a la página Anterior  1, 2
 
"Ayudame" ( Programa De Consola O Terminal)
Autor Mensaje
Responder citando   Descargar mensaje 
Mensaje Re: "Ayudame" ( Programa De Consola O Terminal) 
 
v3ctor escribió: [Ver mensaje]
jousseph escribió: [Ver mensaje]
v3ctor escribió: [Ver mensaje]
[quote user="jousseph" post="32350"] experimentar con los ejemplos de consola en gambas.[/quote]

no tengo claro cuales son..
podrías enumerarlos acá?


V3ctor mi consola la desarrolle desde el gambas 3.1 y ahorita noto que el gambas moderno trae las cosas diferentes busca en la famosa granja si esta la consola de comandos si no te perdiste algo valioso.


lo he recuperado primero descargar los ejemplos viejos ver imagen
 888
segundo ir a  ver imagen

 999


' gambas class file


Private $hProcess As Process
Private $sText As String

Static Public Sub Main()

  Dim hForm As Form

  hForm = New FConsole
  hForm.Show

End


Public Sub _new()

  $hProcess = Exec ["bash", "--noediting"] For Input Output As "Process"

End


Public Sub Form_Close()

  $hProcess.Kill

End


Public Sub Process_Read()

  Dim sStr As String

  'Debug Eof(Last);; Lof(Last);;
  'While Not sStr
  Read #$hProcess, sStr, -256
  'Wend
  'Error sStr
  $sText = $sText & sStr
  'Debug Quote(sStr)
  UpdateConsole

End


Public Sub Process_Error(sStr As String)
  
  $sText = $sText & sStr
  UpdateConsole
  
End

Private Sub UpdateConsole()

  Dim iPos As Integer
  Dim sStr As String
  
  While Len($sText)
  
    iPos = InStr($sText, "\n")
    If iPos = 0 Then iPos = Len($sText)
    
    sStr = Normalize(Left$($sText, iPos))
    'Debug sStr
    $sText = Mid$($sText, iPos + 1)
    
    txtConsole.Pos = txtConsole.Length
    txtConsole.Insert(sStr)
  
  Wend
  
End



Public Sub Process_Kill()
  
  'hProcess = NULL
  Try Me.Close
  
End



Public Sub txtCommand_Activate()
  
  Dim sLig As String
  
  sLig = txtCommand.Text & gb.NewLine
  
  'txtConsole.Pos = txtConsole.Length
  'txtConsole.Insert("# " & sLig)
  txtCommand.Clear

  sLig = Conv$(sLig, Desktop.Charset, System.Charset)
  
  Print #$hProcess, sLig;
  
End


Static Private Function Normalize(sStr As String) As String

  Dim sNorm As String
  Dim iInd As Integer
  Dim iCar As Integer
  Dim bEsc As Boolean

  ' For iInd = 1 To Len(sStr)
  '
  '   iCar = Asc(sStr, iInd)
  '
  '   If iCar = 27 Then
  '     bEsc = True
  '     Continue
  '   Endif
  '
  '   If bEsc Then
  '     If iCar < 32 Then bEsc = False
  '     Continue
  '   Endif
  '
  '   If iCar < 32 And iCar <> 10 Then iCar = 32
  '
  '   sNorm = sNorm & Chr$(iCar)
  '
  ' Next
  
  sNorm = sStr
  
  If System.Charset = Desktop.Charset Then
    Return sNorm
  Else
    Return Conv$(sNorm, System.Charset, Desktop.Charset)
  Endif
  
End

Public Sub Form_Open()

  txtCommand.SetFocus

End

Public Sub btnCtrlC_Click()

  Print #$hProcess, Chr$(3);

End

Public Sub btnCtrlD_Click()

  Print #$hProcess, Chr$(4);

End

Public Sub btnCtrlZ_Click()

  Print #$hProcess, Chr$(26);

End
 


Perfecto alli esta la conexion con el bash, para muchos espero les interese, esto tiene muchas sorpresitas brillantes algunos ya lo saben otros que ni se lo imaginan, con eso he logrado hasta asesinar todos los procesos del sistema sin ser superusuario y agregar ejecuciones con un click sin comandos, suerte, espero termines con exito tu proyecto, saludos.
 



 
jousseph - Ver perfil del usuarioEnviar mensaje privadoVer la galería personal del usuario 
Volver arribaPágina inferior
Mostrar mensajes anteriores:    
 
OcultarTemas parecidos
Tema Autor Foro Respuestas último mensaje
No hay nuevos mensajes Letras "p" Y "z" Minú... drjuano Controles/Librerías/Componentes 8 Jueves, 28 Abril 2011, 21:48 Ver último mensaje
santijav
No hay nuevos mensajes Un Detalle Con El Insert Into Gambas Value... jousseph Bases de Datos 5 Domingo, 04 Noviembre 2012, 20:58 Ver último mensaje
Shell
No hay nuevos mensajes Exec "Imprimir Contenido Del Consola&... chen_08 General 6 Lunes, 10 Junio 2013, 19:31 Ver último mensaje
Cubel
No hay nuevos mensajes Mensaje De Consola: Gtk-Message: Failed To... gambafeliz Controles/Librerías/Componentes 2 Sabado, 13 Julio 2019, 18:12 Ver último mensaje
gambafeliz
 

Publicar nuevo tema  Responder al tema  Página 2 de 2
Ir a la página Anterior  1, 2

Usuarios navegando en este tema: 0 registrados, 0 ocultos y 1 invitado
Usuarios registrados conectados: Ninguno


 
Lista de permisos
No puede crear mensajes
No puede responder temas
No puede editar sus mensajes
No puede borrar sus mensajes
No puede votar en encuestas
No puede adjuntar archivos
Puede descargar archivos
No puede publicar eventos en el calendario



  

 

cron