用input流读取了一个文件,然后我想把文件的数据放入一个list里面,应该怎么做?
解决方案 »
- 请问用CSharpCodeProvider创建类无法使用Lamda表达示?
- 在DataTable里怎样找到序号字段值最大的那一行,并返回行序号字段的值?
- 如何动态的为“DataGrid”添加“列”???
- [招兼职]参与开发一个基于WEB的自动化监测采集系统
- 散分,顺便带个问题
- 关于DataGrid显示自己指定的列标题和列?
- 我安装了第三方组件,如何在C#中使用
- socket 想异步传输大数据,怎么实现?
- WinForm与数据库交互的问题
- 在WINFORM设计中,我有一些数据需要供整个应用程序访问,我怎么实现??
- c#使用DirectX编写播放器出现的问题,自己机子上没问题,同样的程序拷到别人机子上报错
- 请做过权限的牛人来看看
FileStream inStream = null;
inStream = File.OpenRead("C:\\inStream\\acer\\Desktop\\students.input");然后如何把inStream放入List<>中?
其实无论哪种都不难的,呵呵,自己read的时候搞就OK了
List<byte> s = new List<byte>();
FileStream inStream = null;
inStream = File.OpenRead("C:\\inStream\\acer\\Desktop\\students.input");
long filelength = inStream.Length;
byte[] bytes = new byte[filelength]; inStream.Read(bytes, 0, (int)filelength); s.AddRange(bytes);不是没有问题,仅供参考
s.Add(x);
是要这样嘛?