
October 23rd, 2003, 03:22 PM
|
|
Junior Member
|
|
Join Date: Oct 2003
Posts: 6
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
.NET to VB6.0 help!
Hey, im changing from Visual Basic.NET to Visual Basic 6.0, so i can make Win32 programs, cause VB.NET really made me sick because the user has to have .NET Framework instaled. Anyway now i bought VB 6.0 and i am trying to create a file, and write data to it. ive figured this out myself if .NET,,,it looks something like this (i am writing from my mind not copy + paste so i might have some spelling mistakes)
Quote:
'Firstly in the top of the code window:
Imports System
Imports System.IO
then in the button click command
'This is the StreamWriter way...
Dim strDestination as String
Dim SW as StreamWriter
SaveFileDialog1.ShowDialog
strDestination = SaveFileDialog1.FileName
SW = File.CreateText (strDestination)
SW.WriteLine ("This is what I want to write")
Sw.WriteLine ("Another example ")
SW.WriteLine (TextBox1.Text)
Sw.Close
'This is the comma separated database!
'FileOpen (FileNumber, Destination, OpenMode)
FileOpen (1, strDestination, OpenMode.OutPut)
'WriteLine (FileNumber, What to write)
WriteLine (1, "Hey this is record number 1")
WriteLine (1, "And this is record number 2")
WriteLine (1, "And this is record number 3")
FileClose (1)
'This is to put the records into variables by the Input Command
'Input (FileNumber, Saved To)
Dim arrTheInputs () as String
Dim IntCounter as String
FileOpen (1, strDestination, OpenMode.Input)
Do Until EOF (1)
ReDim Preserve arrTheInputs (intCounter)
Input (1, arrTheInputs (intCounter))
intCounter = intCounter + 1
Loop
FileClose (1)
'Since we know there is only 3 records.....
MsgBox (arrTheInputs (0))
MsgBox (arrTheInputs (1))
MsgBox (arrTheInputs (2))
End Sub |
And thats it a huge code but pretty good...i want to know how to do something like this in VB6.0..i tried a command FileOpen...but its not there
can someone please help me,,i really need the help
|