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

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -