D
dipique
Hey all, my name is Dan and I'm brand new to C#; all my previous
programming has been in VB6, so this is quite a change. I'd like to
read to and write from a simple text file that's in the app
directory. How do I do that, and what's the accepted way to store
the file in memory? I know in VB it was a string array, but...
anyhow, this is the code I'd use in VB just in case I need to be more
clear:
Dim StringArray() as String
Dim StringLine as String
Dim UB4Array as Integer
Open FileName for Input as #1
Do While Not EOF(1)
Line Input #1, StringLine
If (Not StringArray) = -1 then Redim StringArray(0)
UB4Array = UBound(StringArray) + 1
Redim Preserve StringArray(UB4Array)
StringArray(UBound(StringArray)) = StringLine
Loop
Close #1
That of course is just for input, and I need to know output too, but
that should suffice. Thanks in advance.
Dan
programming has been in VB6, so this is quite a change. I'd like to
read to and write from a simple text file that's in the app
directory. How do I do that, and what's the accepted way to store
the file in memory? I know in VB it was a string array, but...
anyhow, this is the code I'd use in VB just in case I need to be more
clear:
Dim StringArray() as String
Dim StringLine as String
Dim UB4Array as Integer
Open FileName for Input as #1
Do While Not EOF(1)
Line Input #1, StringLine
If (Not StringArray) = -1 then Redim StringArray(0)
UB4Array = UBound(StringArray) + 1
Redim Preserve StringArray(UB4Array)
StringArray(UBound(StringArray)) = StringLine
Loop
Close #1
That of course is just for input, and I need to know output too, but
that should suffice. Thanks in advance.
Dan