如何使用c#使用列表框显示i / o的输出 [英] how to display outputs from i/o using listbox using c#

查看:122
本文介绍了如何使用c#使用列表框显示i / o的输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用FRID阅读器和标签为我的项目创建q程序。我正在使用Impinj R420阅读器来阅读标签。我可以阅读标签并仅在控制台中显示它。我只想使用列表框或任何可用于显示标签信息的表单在Windows窗体中显示我的输出。有人可以帮帮我吗?我只想问一些关于如何从i / o流显示多个输出到列表框的示例。



谢谢。

I am creating q program for my project using FRID reader and Tags. I am using Impinj R420 reader to read the tags. I can read the tags and display it in console only. I just want to display my Output in windows form using listbox or any form that it can use to display the tags information. Anyone can help me? Im just asking for some example on how display multiple outputs to a listbox from i/o streaming.

thank you.

推荐答案

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;

namespace WindowsFormsApplication2
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void Form3_Load(object sender, EventArgs e)
        {
            string line;
            System.IO.StreamReader file = 
            new System.IO.StreamReader(@"C:\Project Files\MyTestFile.txt");
            while ((line = file.ReadLine()) != null)
            {
                listBox1.Items.Add(line);
            }

            file.Close();
        }
    }
}


这篇关于如何使用c#使用列表框显示i / o的输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆