BinaryReader.ReadInt32 取得的数不同的问题

popcorn330 2010-05-05 08:30:50
private void button3_Click(object sender, EventArgs e)

{



System.Windows.Forms.OpenFileDialog fg = new OpenFileDialog();

fg.Filter = "ubx(*.ubx)|*.ubx";

fg.FilterIndex = 1;

fg.DereferenceLinks = true;

fg.RestoreDirectory = true;



if (fg.ShowDialog() == DialogResult.OK)

{



FileStream fs = new FileStream(fg.FileName, FileMode.Open);



BinaryReader br = new BinaryReader(fs);

GPSSateBinary gpss = new GPSSateBinary();

//无效信息8位

br.ReadChars(8);

//头4位

br.ReadChars(4);

//时间

gpss.ObTime = br.ReadInt32() / 1000;

gpss.WeekNo = br.ReadInt16();





}





}

代码如上,关键就在

gpss.ObTime = br.ReadInt32() / 1000; 这句话出问题了。

同样的代码,同样的二进制文件。在我的机器上和同事机器上得到的数不一样。请问何解?
...全文
121 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

17,740

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧