如下面内容是UserDataInfo.ini中的内容
admin
09477112
09477114
09477115
09516789
把UserDataInfo.ini中的每一行的值赋值一维数组public string[] x=new string[5]StreamReader UserDataNAME = new StreamReader("D:\\data\\UserDataInfo.ini");上面的语句是我用来打开制定文件的,请不要搞成别的好嘛!!!
对于读取文档中的一行并赋值给字符串是可以的: string x1 = UserDataNAME.ReadLine();
UserDataNAME.Close();但怎样复制给数组就不会了……public int count=0;……while (UserDataName.Peek() > -1)
{
x[count]=?
count++;
}请各位帮帮忙啊!谢谢……
admin
09477112
09477114
09477115
09516789
把UserDataInfo.ini中的每一行的值赋值一维数组public string[] x=new string[5]StreamReader UserDataNAME = new StreamReader("D:\\data\\UserDataInfo.ini");上面的语句是我用来打开制定文件的,请不要搞成别的好嘛!!!
对于读取文档中的一行并赋值给字符串是可以的: string x1 = UserDataNAME.ReadLine();
UserDataNAME.Close();但怎样复制给数组就不会了……public int count=0;……while (UserDataName.Peek() > -1)
{
x[count]=?
count++;
}请各位帮帮忙啊!谢谢……
解决方案 »
- windows服务如何监视电脑系统时间被修改
- ListView一列显示
- An existing connection was forcibly closed by the remote host(WCF)
- c# 合并两个gif格式图片
- C#打开excel的问题
- ae中如何将地图以及DrawShape出来的IGeomtry一起导出图片上
- 字符串比较问题!
- 怎么判断打印完毕
- 如何调用remoting?
- 各位谈谈传统项目迁移到.Net上的好处
- 如何开发一款FLASH打包程序?
- 关于利用WebRequest向一个网站发送数据,网站用QueryString接收不到参数的问题,高手请进,急????????????????????
记得结贴
给你简单的方法还不乐意……非要用原始的麻烦方法……public string[] x=new string[5];
StreamReader UserDataNAME = new StreamReader("D:\\data\\UserDataInfo.ini");
while (UserDataName.Peek() > -1)
{
x[count]= UserDataName.ReadLine();
count++;
}
UserDataName.Close();