Ciao a tutti..
Devo fare una cosa semplice ma sto impazzendo a farla..
Sto facendo un'applicatico in vb.net con visual studio 2005 che giri su un palmare in cui è installato windows CE .
L'applicativo deve leggere un file, fare una minima interrogazione e salvare tutto in fondo ad un'altro file ... Tutto qui...
Un'applicazione base base riesco a farla girare sul palmare, ma la lettura e la scrittura sul file non so proprio che comandi utilizzare.
Sul mio pc ho fatto un'applicativo windows che funziona, ma alcuni comandi se creo un progetto per windows CE nn le riconosce.
Questo è piu o meno il codice che devo "tradurre":
Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub cmdEsci_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdEsci.Click
Close()
End Sub
Private Sub cmdSalva_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdSalva.Click
Dim x As Object
Dim ind, nomef As Object
Dim riga As String
Dim cod(10) As String
Dim y As Short
nomef = Text1.Text
ind = "F:\Visual Basic\progetto\" + nomef + ".txt"
On Error GoTo nuovo
FileOpen(2, ind, OpenMode.Input)
x = 1
Do While EOF(2) = False
Input(2, riga)
If riga <> "" Then
cod(x) = riga
x = x + 1
End If
Loop
FileClose(2)
On Error GoTo errore
FileOpen(1, ind, OpenMode.Output)
For y = 1 To x
If cod(y) <> "" Then PrintLine(1, cod(y))
Next
PrintLine(1, Text1.Text & " ; " & Text2.Text & " ; " & Text5.Text & " ; " & txtData.Text & " ; " & txtOra.Text & " ;")
FileClose(1)
Exit Sub
nuovo:
'Dim risposta1 As String
'risposta1 = MsgBox("Nuovo file", vbExclamation, "nuovo file")
On Error GoTo errore
FileOpen(1, ind, OpenMode.Output)
PrintLine(1, Text1.Text & " ; " & Text2.Text & " ; " & Text5.Text & " ; " & txtData.Text & " ; " & txtOra.Text & " ;")
FileClose(1)
Exit Sub
errore:
'Dim risposta As String
'risposta = MsgBox("Impossibile aprire il file", vbExclamation, "errore apertura file")
End Sub
Private Sub avanzamento_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
txtData.Text = CStr(Today)
txtOra.Text = CStr(TimeOfDay)
End Sub
Private Sub Text2_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Text2.TextChanged
Dim x As Short
Dim ind As Object
Dim nomef As String
Dim cod(5) As String
ind = "F:\Visual Basic\progetto\operatori.txt"
Text3.Text = ""
On Error GoTo errore
FileOpen(2, ind, OpenMode.Input)
For x = 1 To 4
Input(2, cod(x))
If Left(cod(x), 1) = Text2.Text Then
Text3.Text = LTrim(Replace(cod(x), Text2.Text, ""))
FileClose(2)
Exit Sub
End If
Next
FileClose(2)
Exit Sub
errore:
'Dim risposta As String
'risposta = MsgBox("Impossibile aprire il file", vbExclamation, "errore apertura file")
End Sub
End Class
----------------------------------------------------------------------------------------
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
sarei veramente grato se qualcuno mi desse una mano...
grazie grazie grazie