请大侠看看 这段代码是什么意思?具体是要跟什么参数呢?
以下代码请大侠看看,具体网址是要加什么参数运行吗?=========================================================
<%@ Page language="c#" %>
<%@ Import namespace="System.Xml" %>
<%
Page.Response.Cache.SetExpires(DateTime.Now.AddHours(-1));
string t=getParam("t");
string a=getParam("a");
string p=getParam("p");
if (t=="" || a=="" || p=="")
{
Response.Write("<?xml version=\"1.0\"?>\n<d>ERROR</d>");
}
else
{
int pos = Convert.ToInt32(p);
XmlDocument doc = new XmlDocument();
string file = Server.MapPath("../advert/xmldata/stat.xml");
doc.Load(file);
XmlNode dtnode = doc.SelectSingleNode("/_8bo8/d");
DateTime dt = Convert.ToDateTime(dtnode.InnerText);
if ( DateTime.Now.AddHours(-24)>dt )
{
string tmp = "<?xml version=\"1.0\" encoding=\"gb2312\"?>\n";
tmp += "<_8bo8><d>" + DateTime.Now.ToString("yyyy-MM-dd 00:00:00") + "</d>\n";
tmp += "<f><left></left><right></right><top></top><middle></middle><bottom></bottom><fleft></fleft><fright></fright></f>\n";
tmp += "<b><left></left><right></right><top></top><middle></middle><bottom></bottom><fleft></fleft><fright></fright></b>\n";
tmp += "</_8bo8>";
doc.LoadXml(tmp);
}
XmlNode node = doc.SelectSingleNode("/_8bo8/" + t + "/" + a);
string data=node.InnerText;
data = Record(data, pos);
node.InnerText = data;
doc.Save(file);
Response.Write("<?xml version=\"1.0\"?>\n<d>OK</d>");
}
%>
<script language="c#" runat="server">
string Record(string data, int pos)
{
if (data=="") data = "0";
string[] arr = data.Split(',');
if (pos<arr.Length)
{
arr[pos] = (Convert.ToInt32(arr[pos]) + 1).ToString();
data = arr[0];
for(int i=1; i<arr.Length; i++)
{
data += "," + arr[i];
}
}
else
{
string[] arr2 = new string[pos+1];
for(int i=0; i<arr.Length; i++)
{
arr2[i] = arr[i];
}
for(int i=arr.Length; i<arr2.Length; i++)
{
arr2[i]="0";
}
arr2[pos] = (Convert.ToInt32(arr2[pos]) + 1).ToString();
data = arr2[0];
for(int i=1; i<arr2.Length; i++)
{
data += "," + arr2[i];
}
}
return data;
}
string getParam(string key)
{
string tmp="";
if (Request[key]!=null)
{
tmp = Request[key].ToString();
}
return tmp;
}
</script>