If you go to
http://reflector.red-gate.com/Download.aspx you can
download a program and use it to extract App_Web_mqg4or2q.dll.
The code you need is in _Default
This is it:
public class _Default : Page, IRequiresSessionState
{
// Fields
protected Button Button1;
protected HtmlForm form1;
protected GridView GridView1;
protected HyperLink HyperLink2;
protected Label Label2;
protected Label Label3;
protected RadioButton rbAOLmail;
protected RadioButton rbGmail;
protected RadioButton rbHotmail;
protected RadioButton rbRediffmail;
protected RadioButton rbYahoomail;
protected TextBox TextBox1;
protected TextBox TextBox2;
protected TextBox TextBox3;
protected TextBox TextBox4;
// Methods
protected void Button1_Click(object sender, EventArgs e)
{
string strUserIdTemp = this.TextBox1.Text.Trim();
string strPassword = this.TextBox2.Text.Trim();
if ((strUserIdTemp.Length == 0) || (strPassword.Length == 0))
{
this.Label2.Text = Utility.UseridPassMiss;
this.GridView1.Visible = false;
}
else
{
bool boolIsOK = false;
DataTable dtContatct = new DataTable();
string strError = string.Empty;
MailType mt = this.FindTheMailType();
try
{
strUserIdTemp = this.CheckUserID(mt, strUserIdTemp);
this.Label3.Text = "User ID :" + strUserIdTemp;
MailClient.GetContacts(mt, strUserIdTemp, strPassword,
out boolIsOK, out dtContatct, out strError);
dtContatct = MailClient.GetFormat(mt, dtContatct);
}
catch (Exception exception)
{
this.Label2.Text = exception.ToString();
return;
}
if (!boolIsOK)
{
this.Label2.Text = strError;
this.GridView1.Visible = false;
}
else
{
this.Label2.Text = " Total contacts : " +
dtContatct.Rows.Count.ToString();
if (dtContatct.Rows.Count > 0)
{
this.GridView1.DataSource = dtContatct;
this.GridView1.DataBind();
this.GridView1.Visible = true;
}
}
}
}
private string CheckUserID(MailType mt, string strUserIdTemp)
{
string str = strUserIdTemp;
switch (mt)
{
case MailType.Yahoomail:
return strUserIdTemp;
case MailType.Hotmail:
if (strUserIdTemp.IndexOf("@") != -1)
{
return strUserIdTemp;
}
return (strUserIdTemp + "@
hotmail.com");
case MailType.Gmail:
return strUserIdTemp;
case MailType.AOLmail:
{
int index = strUserIdTemp.IndexOf("@");
if (index < 0)
{
return strUserIdTemp;
}
return strUserIdTemp.Remove(index);
}
case MailType.Rediffmail:
{
int startIndex = strUserIdTemp.IndexOf("@");
if (startIndex < 0)
{
return strUserIdTemp;
}
return strUserIdTemp.Remove(startIndex);
}
}
return str;
}
private MailType FindTheMailType()
{
MailType rediffmail = (MailType) 0;
if (this.rbYahoomail.Checked)
{
return MailType.Yahoomail;
}
if (this.rbHotmail.Checked)
{
return MailType.Hotmail;
}
if (this.rbGmail.Checked)
{
return MailType.Gmail;
}
if (this.rbAOLmail.Checked)
{
return MailType.AOLmail;
}
if (this.rbRediffmail.Checked)
{
rediffmail = MailType.Rediffmail;
}
return rediffmail;
}
protected void Page_Load(object sender, EventArgs e)
{
}
// Properties
protected HttpApplication ApplicationInstance
{
get
{
return this.Context.ApplicationInstance;
}
}
protected DefaultProfile Profile
{
get
{
return (DefaultProfile) this.Context.Profile;
}
}
}