As i told you, you will need StreamReader. It is .NET class, not MFC or other, so there you musn't include iostream, fstream and windows.h. Include file Windows.h often couses compile problem in .Net framework project. so remove all these include you will Need to add in form1.h file not in form1.cpp. using namespace System::IO;
public ref class Form1: public System::Windows::Forms::Form // This is a class of a form. ref command is in .NET 2.0 if you use .NET 1.1 then it is __gc
{
public:
Form1(void) ... // Default consrtuctor
...
Private: StreamReader ^streamFile;
Private: String ^streamReadLine;
...
public: ReadFile(void)
{
streamFile = File::OpenText("test.txt");
while (streamFile->EndOfStream != true)
{
streamReadLine = streamFile->ReadLine();
}
}
};
If you still don't know, at least tell me witch .net framework you are using.