javascript - System.OverflowException in converting js to C# -


var pin = parseint(form.mac.value.slice(-6), 16) % 10000000; 

i'm convert js c# this

var pin = convert.toint16(networks[networkindex, 0].substring(networks[networkindex, 0].length - 6)) % 10000000; 

and error

an unhandled exception of type 'system.overflowexception' occurred in mscorlib.dll additional information: value either large or small int16.

the value big int16. try use convert.toint32.

var pin = convert.toint32(networks[networkindex, 0].substring(networks[networkindex, 0].length - 6)) % 10000000; 

Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

SQL Server - MyCTE query based on 24 hour period (next day) -