Tema: Abrir cajon
Ver Mensaje Individual
  #8 (permalink)  
Antiguo 22/08/2008, 14:19
abaylon
 
Fecha de Ingreso: abril-2008
Mensajes: 23
Antigüedad: 16 años, 11 meses
Puntos: 0
Respuesta: Abrir cajon

Public Sub AbrirCajon()
Dim fw As StreamWriter

LPTPORT = "LPT1" 'El puerto que sea.
hPort = CreateFile(LPTPORT, GENERIC_WRITE, FILE_SHARE_WRITE, SA, OPEN_EXISTING, 0, 0)
hPortP = New IntPtr(hPort) 'Convierte Integer to IntPtr
Safe = New Microsoft.Win32.SafeHandles.SafeFileHandle(hPortP, True)
If Not Safe.IsInvalid Then
outFile = New System.IO.FileStream(Safe, IO.FileAccess.Write)
fw = New System.IO.StreamWriter(outFile)
fw.AutoFlush = True
fw.WriteLine(Chr(27) & Chr(112) & 0) 'Genérico Epson
fw.Close()
End If
CloseHandle(hPort)
End Sub

ALLI ESTA EL CODIGO COMPLETO