日期:2014-05-16  浏览次数:20832 次

难题求助,大神们,谢谢了
这个程序是两个程序浅度用户名整合,webconn是主站,主站和副站的头像,没有统一。现在要在副站的页面上,调用当前用户主页,访客的头像,两个站仅仅用户名一样。其它通通不一样。。如何通过这个条件,,获取主站的头像并写入当前??
注:ob_visit 是副站的访客表,ov_user是主站用户表,里面包括user_icon用户头像。



public class UserLabel : SystemLabel

       
    {
        private UserInfo _userInfo = new UserInfo();
  
        public string showmyvisitor()
        {
            StringBuilder builder = new StringBuilder();
            using (IDataReader reader = DbHelper.ExecuteReader("SELECT TOP 9 v.username,v.usericon,v.userid FROM ob_visit AS v WHERE  v.mainuserid =" + this.userInfo.userid + " AND type= 0 ORDER BY v.PkId DESC "))
            using (IDataReader readers = DbHelper.ExecuteReader(Config.GetConnectionString("webconn").ConnectionString, null, "select * from ov_user where username = '" + this.userInfo.username + "'", CommandType.Text, null))
   
          {
                builder.Append("<div id=\"users\">").Append("<ul>");
                while (reader.Read())
                {
                    while (readers.Read())
                    {
                        builder.Append(reader["userid"]);
                    }
                    builder.Append("<li>");
                    builder.AppendFormat("<div class=\"users_img\"><img src = \"{0}\" /></div><div class=\"users_name\"><a href=\"{1}redirect.aspx?go=user&id={2}\" target=\"_blank\" > " + Utils.HtmlEncode(reader[0].ToString()) + "</a></div>", Utils.FormatPhotoPath(reader[1].ToString(), 1), BlogInfo.BlogUrl, reader[2]);
                    builder.Append("</li>");
                }
                builder.Append("</ul>").Append("</div>");
  
            }
          &nbs