To achieve the above results
CopyCode The Code is as follows: public static string shownewmsg ()
{
String pic1 = "images/yzdp-_15.gif ";
String pic2 = "images/yzdp-_18.gif ";
String pic3 = "images/yzdp-_20.gif ";
String pic4 = "images/yzdp-_22.gif ";
String pic5 = "images/yzdp-_24.gif ";
String pic6 = "images/yzdp-_26.gif ";
String pic7 = "images/yzdp-_28.gif ";
String pic8 = "images/yzdp-_30.gif ";
String pic9 = "images/yzdp-_32.gif ";
String pic10 = "images/yzdp-_34.gif ";
Bjmsginfo info = new bjmsginfo ();
Info. Version = "cn ";
Info. isnew = true;
Datatable dt = WebManager. list (Info, "bjuserinfomsg", "Top 10 userid, title, usertitle, usertype, yzfd, companyName, yzpl, yzfw, yzzl, userpic, comments, createtime, msginfo, category ", "& isnew", "[orderno]");
Stringbuilder builder = new stringbuilder ();
If (Dt. Rows. Count> 0)
{
For (INT I = 0; I <DT. Rows. Count; I ++)
{
Builder. append ("<Table width = '000000' border = '0' cellspacing = '0' cellpadding = 0'> <tr> ");
Builder. append ("<TD width = '6% 'align = 'left' valign = 'middle'> ");
Builder. append ("If (I = 0)
{
Builder. appendformat ("src = '{0}'", pic1 );
}
Else if (I = 1)
{
Builder. appendformat ("src = '{0}'", pic2 );
}
Else if (I = 2)
{
Builder. appendformat ("src = '{0}'", pic3 );
}
Else if (I = 3)
{
Builder. appendformat ("src = '{0}'", pic4 );
}
Else if (I = 4)
{
Builder. appendformat ("src = '{0}'", pic5 );
}
Else if (I = 5)
{
Builder. appendformat ("src = '{0}'", pic6 );
}
Else if (I = 6)
{
Builder. appendformat ("src = '{0}'", pic7 );
}
Else if (I = 7)
{
Builder. appendformat ("src = '{0}'", pic8 );
}
Else if (I = 8)
{
Builder. appendformat ("src = '{0}'", pic9 );
}
Else if (I = 9)
{
Builder. appendformat ("src = '{0}'", pic10 );
}
Builder. append ("width = '15' Height = '12'/> ");
Builder. append ("</TD> <TD width = '000000' align = 'left' valign = 'middle'> ");
// <A href = "qbdp. aspx? CompanyName = <% # eval ("href =" qbdp. aspx? CompanyName = <% # eval ("companyName") %> "> <% # eval (" companyName ") %> </a>
Builder. append ("<a href = ");
Builder. append ("href = ");
Builder. append ("qbdp. aspx? ");
Builder. appendformat ("companyName = '{0}'", DT. Rows [I] [5]. tostring ());
Builder. append ("</a> ");
Builder. appendformat ("{0}", DT. Rows [I] [5]. tostring ());
Builder. append ("</TD> </tr> </table> ");
}
}
Return builder. tostring ();
// Dlnewmsginfo. datasource = DT. defaultview;
// Dlnewmsginfo. databind ();
}