if(Request.ServerVariables["HTTP_REFERER"]!=null)
{
string HTTP_REFERER=Request.ServerVariables["HTTP_REFERER"].ToString().ToLower();
string HTTP_HOST=Request.ServerVariables["HTTP_HOST"].ToString().ToLower();
if(HTTP_HOST==HTTP_REFERER.Substring(7,HTTP_HOST.Length))
{
Response.Write("OK");
}
else
{
Response.Write("ERR");
}
}
else
{
Response.Write("ERR");
}