Re: [問題] 如何執行大筆資料呢
不好意思大大們
我想請問一下我想要抓取文字檔內的數字來進行演算法來運算
可是我輸入在文字檔內的數字跟我實際抓取到的好像不太一樣耶
比如說我在文字檔內輸入
500 100
80 30
50 100
300 20
以下是我的程式碼
public struct Data
{
public string myName;
public int px;
public int py;
public double c;
public double d;
public Data(string name,int X,int Y)
{
myName=name;
px=X;
py=Y;
c=0;
d=0;
}
}
Data Nodedata;
List<Data>C=new List<Data>();
List<Data>D=new List<Data>();
private void button1_click(object sender ,EventArgs e)
{
FileInfo d=new new FileInfo("123.txt");
StreamReader data=d.OpenText();
for(int i=0;i<總資料數;i++)
{
Nodedata.c=Convert.ToInt16((char)data.Read());
C.Add(Nodedata);
Nodedata.d=Convert.ToInt16((char)data.Read());
D.Add(Nodedata);
}
}
如我上面文字檔的資料,但我最後抓到的C 跟D 都不一樣耶 請問大大我是哪裡做錯啦
感謝收看
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.231.33
→
06/22 16:29, , 1F
06/22 16:29, 1F
→
06/22 16:34, , 2F
06/22 16:34, 2F
→
06/22 16:35, , 3F
06/22 16:35, 3F
→
06/22 17:03, , 4F
06/22 17:03, 4F
→
06/22 17:05, , 5F
06/22 17:05, 5F
→
06/22 17:38, , 6F
06/22 17:38, 6F
→
06/22 18:54, , 7F
06/22 18:54, 7F
→
06/22 19:25, , 8F
06/22 19:25, 8F
討論串 (同標題文章)