Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

双击64位整数值抛出异常 #29

Open
qaqz111 opened this issue Feb 17, 2017 · 3 comments
Open

双击64位整数值抛出异常 #29

qaqz111 opened this issue Feb 17, 2017 · 3 comments

Comments

@qaqz111
Copy link

qaqz111 commented Feb 17, 2017

提示超出范围,但是实际上并没有。
比如 20170217093605,并没有超出 64 位整数的范围,双击出现.net的标准异常窗口,提示信息:

System.ArgumentOutOfRangeException: “20170216093600”的值对于“Value”无效。“Value”应介于 'Minimum' 和 'Maximum' 之间。
参数名: Value
在 System.Windows.Forms.NumericUpDown.set_Value(Decimal value)
在 MongoGUICtl.ctlBsonValue.SetValue(BsonValue value, BasicType DataType)
在 FunctionForm.Extend.FrmElement.frmElement_Load(Object sender, EventArgs e)
在 System.Windows.Forms.Form.OnLoad(EventArgs e)
在 System.Windows.Forms.Form.OnCreateControl()
在 System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
在 System.Windows.Forms.Control.CreateControl()
在 System.Windows.Forms.Control.WmShowWindow(Message& m)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.Form.WmShowWindow(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

@magicdict
Copy link
Owner

知道了。我看一下怎么回事。

@magicdict
Copy link
Owner

不好意思,在程序内部使用了int.Max做的,看来要改成decimal.max了。。。

@qaqz111
Copy link
Author

qaqz111 commented Feb 23, 2017

好像还有其他地方也会出这个问题,后来在table视图也遇到一次,但是貌似不是long的类型。

话说对long的类型用long.max就可以了吧,还是说并没有做类型检查?如果没有类型检查的话,要不要decimal.Max貌似没有多大区别?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants