设计qq登陆项目 为什么运行没有显示头像昵称及sidebar分组
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Aptech.UI;
namespace QQ1._0
{
public partial class 主窗体 : Form
{
public 主窗体()
{
InitializeComponent();
}
private void 主窗体_Load(object sender, EventArgs e)
{
showinformation();
sb_窗口.AddGroup("我的好友");
sb_窗口.AddGroup("陌生人");
sb_窗口.AddGroup("黑名单");
showfriendlist();
}
public void showinformation()
{
SqlConnection myconn = DB.connection;
string 昵称 = null;
int FaceId = 0;
if (myconn.State == ConnectionState.Closed)
{
myconn.Open();
}
string sql = "select NickName,FaceId from Users where Id='" + UserHelper.UserID + "'";
SqlCommand mycmm = new SqlCommand(sql, myconn);
SqlDataReader dr = mycmm.ExecuteReader();
if (dr.Read())
{
昵称 = dr["NickName"].ToString();
FaceId =(int) dr["FaceId"];
}
lab_昵称QQ号.Text = UserHelper.UserID + 昵称;
pb_QQ头像.Image = il_图片.Images[FaceId];
}
private void showfriendlist()
{
sb_窗口.Groups[0].Items.Clear();
SqlConnection myconn = DB.connection;
if (myconn.State == ConnectionState.Closed)
{
myconn.Open();
}
string sql = string.Format("select FriendId,NickName from Users,Friends where Friends.HostId={0} and Friends.HostId=Users.Id ", UserHelper.UserID);
SqlCommand mycmm = new SqlCommand(sql, myconn);
SqlDataReader dr = mycmm.ExecuteReader();
while (dr.Read())
{
SbItem item = new SbItem((string)dr["NickName"], (int)dr["FaceId"]);
item.Tag = (int)dr["FriendId"];
sb_窗口.Groups[0].Items.Add(item);
}
dr.Close();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using Aptech.UI;
namespace QQ1._0
{
public partial class 主窗体 : Form
{
public 主窗体()
{
InitializeComponent();
}
private void 主窗体_Load(object sender, EventArgs e)
{
showinformation();
sb_窗口.AddGroup("我的好友");
sb_窗口.AddGroup("陌生人");
sb_窗口.AddGroup("黑名单");
showfriendlist();
}
public void showinformation()
{
SqlConnection myconn = DB.connection;
string 昵称 = null;
int FaceId = 0;
if (myconn.State == ConnectionState.Closed)
{
myconn.Open();
}
string sql = "select NickName,FaceId from Users where Id='" + UserHelper.UserID + "'";
SqlCommand mycmm = new SqlCommand(sql, myconn);
SqlDataReader dr = mycmm.ExecuteReader();
if (dr.Read())
{
昵称 = dr["NickName"].ToString();
FaceId =(int) dr["FaceId"];
}
lab_昵称QQ号.Text = UserHelper.UserID + 昵称;
pb_QQ头像.Image = il_图片.Images[FaceId];
}
private void showfriendlist()
{
sb_窗口.Groups[0].Items.Clear();
SqlConnection myconn = DB.connection;
if (myconn.State == ConnectionState.Closed)
{
myconn.Open();
}
string sql = string.Format("select FriendId,NickName from Users,Friends where Friends.HostId={0} and Friends.HostId=Users.Id ", UserHelper.UserID);
SqlCommand mycmm = new SqlCommand(sql, myconn);
SqlDataReader dr = mycmm.ExecuteReader();
while (dr.Read())
{
SbItem item = new SbItem((string)dr["NickName"], (int)dr["FaceId"]);
item.Tag = (int)dr["FriendId"];
sb_窗口.Groups[0].Items.Add(item);
}
dr.Close();
}
}
}