# 一个逻辑问题 路过的大侠帮忙看下吧 !

0

```                        while (stream8_12.Position < stream8_12.Length)//126
{

DataRow tempSix = resultDtListSix_12.NewRow();
tempSix[0] = "20" + statr_yyyy_08H + "-" + statr_MM_08H + "-" + statr_dd_08H + ":" + statr_hh_08H + ":" + statr_mm_08H + ":" + statr_ss_08H;
tempSix[1] = sd;
for (int ss = 0; ss < zt.Length; ss++)
{
tempSix[ss + 2] = zt[ss].ToString() == "0" ? "是" : "否";
}
}```

stream8_12 是流

1 2 3 4 5 6 ~~~~~~~~~~~~~~~~~~126
127 128 129 130 131 132 ~~~~~~~252

253 254 255 256 257 258 259~~~~~~ 504

s_p | 菜鸟二级 | 园豆：281

0

Launcher | 高人七级 |园豆：45045 | 2014-07-22 14:38

1 2 3 4 5 6 ~~~~~~~~~~~~~~~~~~126
127 128 129 130 131 132 ~~~~~~~252

253 254 255 256 257 258 259~~~~~~ 504

你对着代码看这个  1 2 3 4  5 6  代表时间 位 这个只循环一次 在126这个循环里

s_p | 园豆：281 (菜鸟二级) | 2014-07-22 14:42

@s_p: 然后呢？

Launcher | 园豆：45045 (高人七级) | 2014-07-22 14:46

@Launcher: 我写了下 按自己的想法 我也描述不清楚问题 文字描述有点困难

```                    if (dataList_8H.Rows.Count > 0)
{
var tempByte = (byte[])dataList_8H.Rows[0]["DP_RecvParamValue"];
stream8_12 = new MemoryStream();
byte[] tempByteList = new byte[tempByte.Length];
stream8_12.Write(tempByteList, 0, tempByte.Length);
stream8_12.Position = 0;
var count_8H = byteToHexStr(count_8HTemp);
stream8_12.Position = 15;
if (int.Parse(count_8H) * 126 != stream8_12.Length - 17)
{
dtAssignment(null);
return;
}
long tempIndex = 1;
while (stream8_12.Position < stream8_12.Length)//126
{

for (long k = stream8_12.Position; k < tempIndex * 126; k++)
{
DataRow tempSix = resultDtListSix_12.NewRow();
tempSix[0] = "20" + statr_yyyy_08H + "-" + statr_MM_08H + "-" + statr_dd_08H + ":" + statr_hh_08H + ":" + statr_mm_08H + ":" + statr_ss_08H;
tempSix[1] = sd;
for (int ss = 0; ss < zt.Length; ss++)
{
tempSix[ss + 2] = zt[ss].ToString() == "0" ? "是" : "否";
}
}
tempIndex++;
if (tempIndex >long.Parse( count_8H))
{
break;
}
}
dtAssignment(resultDtListEight_12);
stream8_12.Close();
}```
s_p | 园豆：281 (菜鸟二级) | 2014-07-22 14:49

@s_p: 来学习下如何描述文件结构：http://blog.csdn.net/chun_hua/article/details/6053035

Launcher | 园豆：45045 (高人七级) | 2014-07-22 14:52

您需要登录以后才能回答，未注册用户请先注册