Logo UGIdotNET

Discussione 'Uso di files creati in VB6 for RandomAccess'

# Pubblicato il 25 mar 2004 10.36 - Rispondi
genesio galbiati
Uso di files creati in VB6 for RandomAccess
Ciao a tutti.

Devo leggere e scrivere alcuni files binari creati da VB6 con la seguente istruzione:
Open nomeFile For Random Access Write Lock Write As fpPC_A Len = Len(spec)

In VB.Net che classi devo usare per gestire questi files???

Riporto la struttura del file utilizzata in VB6:

Type specVAX
POSTO As String * L_POSTO_VAX
cod_prod As String * L_COD_PROD_VAX
Prodotto As String * L_PRODOTTO_VAX
Specifica As String * L_SPEC_VAX
appretto As String * L_APPRETTO_VAX
tipo_elica As String * L_ELICA_VAX
PETTINE_DIV As String * L_PETTINE_DIV_VAX
pettine_rinv As String * L_PETTINE_RINV_VAX
spec_prova As String * L_SPEC_PROVA_VAX
data_vax As String * L_DATA_VAX
dati(NUM_DATI_SPEC_VAX) As Integer
dati_real(NUM_REAL_SPEC_VAX) As Single
End Type

Type matr
POSTO(1 To PLC_NUM) As specVAX
End Type

Public spec As matr

fpPC_A = FreeFile
Open nomeFile For Random Access Read Shared As fpPC_A Len = Len(spec)
Get fpPC_A, 3, spec 'legge il terzo record del file


Grazie in anticipo a chi mi vorrà aiutare.
# Pubblicato il 30 mar 2004 11.18 - Rispondi
Marco Barzaghi
Re: Uso di files creati in VB6 for RandomAccess
prova dare un occhio a "FileInfo.OpenRead Method" http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemiofileinfoclassopenreadtopic.asp

HTH M.rkino

© 2001 User Group Italiano UGIdotNET. Tutti i diritti riservati. Note legali. - Partita IVA 01927050185