how to read a file in C#?

Posted by Vivekjj under C# on 2/1/2013 | Points: 10 | Views : 966 | Status : [Member] | Replies : 1
Hi,

i need to get particular content from uploaded files.

For ex: if we upload resume means i need get mobile number and email id from that uploaded resume.

is there any code for this ?




Responses

Posted by: Kusumas on: 2/1/2013 [Member] Starter | Points: 25

Up
0
Down
private string GetRequiredText(string strfirstMatch,string lastMatch)
{
string requiredData="";

bool firstMatch=false;
TextReader tr=new StreamReader("c://abc.txt");
string text_wrd = "";
while (true)
{
text_wrd = Convert.ToString(tr.ReadLine());
if (text_wrd == null)
{
strReturn = "Not_Found";
break;
}
else
{
if(firstMatch==false)

{
if(text_wrd==strfirstMatch)
firstMatch=true;
}
else
{
if(text_wrd==lastMatch)
return requiredData;
else
requiredData=requiredData+text_wrd;
}

}
}
return requiredData;
}


Vivekjj, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response