I am taking a button command from Vb2010 and I have to use it in a VB6 program... What I have is below...Can someone tell me why this doesn't work in VB6? The program takes fields from the user and enters them into a text.INI file...


Private Sub Command1_Click()
Dim path As String = "C:\test.INI" ' PROBLEM

If IO.File.Exists("C:\test.INI") Then
Dim companyFile As IO.TextWriter
companyFile = IO.File.AppendText(path)
companyFile.WriteLine (( Address.Text)) ' writes address to file
companyFile.WriteLine (( Name.Text)) ' writes name to file
companyFile.WriteLine (( Number.Text)) ' writes number to file
companyFile.Flush() 'PROBLEM
companyFile.Close() 'PROBLEM
End If
End Sub