日期:2014-05-17 浏览次数:20637 次
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.IO;
namespace ReadData
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitListView(this.listView1);
}
private void button1_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
}
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void InitListView(ListView ListView)
{
//?针对数据库的字段名称,建立与之适应显示表头?
listView1.Columns.Add("测点编号", 60, HorizontalAlignment.Right);
listView1.Columns.Add("数据", 100, HorizontalAlignment.Left);
listView1.Columns.Add("状态", 100, HorizontalAlignment.Left);
//listView1.Columns.Add("类型名称", 100, HorizontalAlignment.Left);?
listView1.View = View.Details;
listView1.GridLines = true;
listView1.FullRowSelect = true;
string[] rdContent = File.ReadAllLines(@"d:\test\test.txt", Encoding.Default);
string[] buf;
DataSet ds = new DataSet("DataSet");
DataTable dt = ds.Tables.Add("ItemConfig");
&nbs