Igual como escribirias y leerias cualquier archivo
y para detectarlos
http://foro.elhacker.net/programacion_vb/source_detectar_unidades_extraibles_usb-t214774.0.html;msg1030424
Código (VB) [Seleccionar]
'---------------------------------------------------------------------------------------
' Procedimiento : ReadFile
' Autor : Karcrack
' Fecha : 07/04/2009
' Parametro(s) : sPath -> La ruta del fichero
' Return : Devuelve un Byte array con los bytes del fichero
'---------------------------------------------------------------------------------------
Private Function ReadFile(ByVal sPath As String) As Byte()
Dim bvTmp() As Byte
Open sPath For Binary As #1
ReDim bvTmp(0 To LOF(1) - 1)
Get #1, , bvTmp
Close #1
ReadFile = bvTmp
End Function
'---------------------------------------------------------------------------------------
' Procedimiento : SaveFile
' Autor : Karcrack
' Fecha : 07/04/2009
' Parametro(s) : bvData() -> Array de datos
' sPath -> Ruta de guardado
'---------------------------------------------------------------------------------------
Private Sub SaveFile(ByRef bvData() As Byte, ByVal sPath As String)
Open sPath For Binary As #1
Put #1, , bvData
Close #1
End Sub
y para detectarlos
http://foro.elhacker.net/programacion_vb/source_detectar_unidades_extraibles_usb-t214774.0.html;msg1030424