I know its not fair answering owns question. But I'm going to do that.
First:
Download all results from web.
The query string is:
string url = "http://www.educationboardresults.gov.bd/arch/result.php?roll=" + roll + "&board=dhaka&exam=HSC&year=" + year;
Call it from a loop:
for (i = startfrom; i <= endat; i++)
{
HSC_WEB hw = new HSC_WEB(i, year);
hw.MyEvent += new HSC_WEB.ProgressDelegate(hw_Completed);
TotalReq += 1;
................
}
Second: Purse html text to plain text using webbrowser. It removes all tags and comments.
Third:With that plain text(sample text given in my question) the following class find all I wanted.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HSC_RES_Downloader
{
class stringsearch
{
public stringsearch( string BaseString)
{
this.BaseString = BaseString;
}
public string BaseString;
public string getyear()
{
return getstring(BaseString, "HSC", "", "Result");
}
public string getroll()
{
return getstring(BaseString, "Roll No.", "", "Registration");
}
public string getregno()
{
return getstring(BaseString, "Registration No.", "", "Academic Session");
}
public string getSession()
{
return getstring(BaseString, "Academic Session", "", "Name");
}
public string getname()
{
return getstring(BaseString, "Academic Session", "Name", "Father's Name");
}
public string getfname()
{
return getstring(BaseString, "Father's Name", "", "Institute");
}
public string getInstitutenane()
{
return getstring(BaseString, "Institute Name", "", "Center");
}
public string getCenter()
{
return getstring(BaseString, "Center Name", "", "Student Group");
}
public string getGroup()
{
return getstring(BaseString, "Student Group", "", "Student Type");
}
public string getsType()
{
return getstring(BaseString, "Student Type", "", "Result");
}
public string getResult()
{
return getstring(BaseString, "Student Type", "Result", "GPA");
}
public string getGPA()
{
return getstring(BaseString, "GPA", "", "Subject-wise");
}
public List<List<string>> subjectsgpa()
{
List<string> sublist;
string substr="BENGALI,ENGLISH,SECRETARIAL MANAGEMENT,COMMERCIAL GEOGRAPHY,"+
"STATISTICS,COMPUTER STUDIES,AGRICULTURE STUDIES," +
"PRINCIPLE OF BUSINESS,ACCOUNTING,"+
"PHYSICS,CHEMISTRY,MATHEMATICS,BIOLOGY,"+
"SOCIAL WELFARE,ISLAMIC HISTORY,ISLAMIC STUDIES,CIVICS";
sublist = substr.Split(',').ToList();
int ps1 = 0;
ps1 = BaseString.IndexOf("Code Subject Grade/ Marks");
substr = BaseString.Substring(ps1 + "Code Subject Grade/ Marks".Length);
string gpa=string.Empty ;
List<List<string>> subgpas = new List<List<string>>();
foreach (string SubName in sublist)
{
ps1 = substr.IndexOf(SubName);
if (ps1 > 0)
{
List<string> subgpa = new List<string>();
gpa = substr.Substring(ps1+SubName.Length,2);
subgpa.Add(gpa.Trim());
subgpa.Add( SubName);
subgpas.Add(subgpa);
}
}
return subgpas ;
}
public string getstring(string basestr, string str1, string str2, string endstring)
{
int ps1 = 0, ps2 = 0, ps3 = 0;
ps1 = basestr.IndexOf(str1);
ps2 = basestr.IndexOf(str2, ps1 + str1.Length);
ps3 = basestr.IndexOf(endstring, ps2);
string ss = basestr.Substring(ps2 + str2.Length, ps3 - ps2 - str2.Length);
ss = ss.Trim();
return ss;
}
}
}
I still have a lot of things to do. Any modification will be appreciated.