请问怎么将一个文件读到一个字符串数组里面啊?
解决方案 »
- 使用OleDbDataAdapter和OleDbCommandBuilder更新Access表的问题
- 求教,分数字符串如何转为float
- validating和validated事件处理程序什么时候调用?
- 走过,看过,不能错过!来就送分。这事需要来个高手
- 如何在WebBrowser控件中获取post参数?就像获取cookie一样。
- 超简单我却郁闷的问题,声明并初始化TcpClient
- 怎样在C#中实现VS.NET中调试信息窗口的自动滚动功能?
- 问一个菜的问题,事件与委托的问题!!
- 我想用ListView控件做成类型outlook邮件列表的风格,但点击列标头排序应怎样写?
- C#解析pcap文件
- treeview数据绑定高手请教
- mdi多文档界面C#程序触发问题
// string html = "";
/// do
// {
// input = sr.ReadLine();
// if(input != "")
// {
// html = html + input + "\r\n";
// }
// }while(sr.Peek()!=-1);
string str1=sr.ReadToEnd();
sr.Close();
string[] strArr=str1.Split('\n');
public Array ReadFile(string filePath)
{
int i = 0;
int line;
StreamReader sr;
sr = File.OpenText(filePath);
string s = sr.ReadLine();
while (s != null)
{
line++;
s = sr.ReadLine();
}
Item = new string[line];
s = sr.ReadLine();
while (s != null)
{
Item[i] = s;
s = sr.ReadLine();
i++;
}
}
我这个写的对吗?