// text_read.cpp
// compile with: /clr
#using<system.dll>
using namespace System;
using namespace System::IO;

#include <iostream>

using namespace std;
int main()
{
String^ fileName = "e:\\test.txt";
try
{
//Console::WriteLine("trying to open file {0}...", fileName);
StreamReader^ din = File::OpenText(fileName);

String^ str;
int count = 0;
while ((str = din->ReadLine()) != nullptr)
{
count++;
Console::WriteLine("line {0}: {1}", count, str );
}
}
catch (Exception^ e)
{
if (dynamic_cast<FileNotFoundException^>(e))
Console::WriteLine("file '{0}' not found", fileName);
else
Console::WriteLine("problem reading file '{0}'", fileName);
}


system("pause");
//std::cout << "Paused, press ENTER to continue." << std::endl;
//cin.ignore(1000000);

return 0;

}




with that above code i am able to read from a text file and display the content. But it displays the whole content of the file. Please help me modify the codes so that I can only display one particular line.
Help will really be appreciated