日期:2014-05-17 浏览次数:21226 次
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication22
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int couns=0;
listView1.View = View.Details;
ColumnHeader ch1 = new ColumnHeader();
ch1.Text = "序号";
ColumnHeader ch2=new ColumnHeader();
ch2.Text = "账号";
ColumnHeader ch3=new ColumnHeader();
ch3.Text = "密码";
listView1.Columns.Add(ch1);
listView1.Columns.Add(ch2);
listView1.Columns.Add(ch3);
OpenFileDialog file = new OpenFileDialog();
if (file.ShowDialog() == DialogResult.OK) {
FileStream fs=new FileStream(file.FileName,FileMode.Open);
StreamReader sr = new StreamReader(fs);
sr.BaseStream.Seek(0, SeekOrigin.Begin);
while (!sr.EndOfStream) { &n