日期:2014-05-20 浏览次数:20734 次
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void Form3_Load(object sender, EventArgs e)
{
webBrowser1.DocumentText = CreateHtml();
}
private class DataInfo
{
public int ServerID { get; set; }
public DateTime Date { get; set; }
public int Price { get; set; }
public int Users { get; set; }
public int ARpu { get; set; }
}
public class ServerInfo
{
public int ServerID { get; set; }
public string ServerName { get; set; }
}
private string CreateHtml()
{
List<ServerInfo> servers = new List<ServerInfo>();
servers.Add(new ServerInfo() { ServerID = 1, ServerName = "服务器1" });
servers.Add(new ServerInfo() { ServerID = 2, ServerName = "服务器2" });
servers.Add(new ServerInfo() { ServerID = 3, ServerName = "服务器3" });
List<DataInfo> datas = new List<DataInfo>();
datas.Add(new DataInfo() { ServerID = 1, ARpu = 100, Date = DateTime.Parse("2013-1-2"), Price = 1500, Users = 1100 });
datas.Add(new DataInfo() { ServerID = 1, ARpu = 190, Date = DateTime.Parse("2013-1-3"), Price = 1600, Users = 1230 });
datas.Add(new DataInfo() { ServerID = 1, ARpu = 187, Date = DateTime.Parse("2013-1-4"), Price = 1200, Users = 180 });
datas.Add(new DataInfo() { ServerID = 1, ARpu = 120, Date = DateTime.Parse("2013-1-5"), Price = 1300, Users = 176 });
datas.Add(new DataInfo() { ServerID = 2, ARpu = 200, Date = DateTime.Parse("2013-1-2"), Price = 2500, Users = 2100 });
datas.Add(new DataInfo() { ServerID = 2, ARpu = 290, Date = DateTime.Parse("2013-1-3"), Price = 2600, Users = 2230 });