Home > Net > On the c # String. The split (params char [] the separator)
On the c # String. The split (params char [] the separator)
Time:10-10
On the issue of the character segmentation function, has compiled executable problem, I in win 7. The.net runtime 4.6 environment can be normal use, but in the win 10. NET 4.7.2, has been submitted to this function has a problem, don't know what the reason, check on the Microsoft website, above can be normal use, but it is an error, the following is an error code, is there any great god know, inform, thank you. The code is as follows:
string [] STR=DataInput_KeyBoardLocation. Text. The Split (', '); The Regex. List. DataInputInformation. KeyShowPosition_X=the Convert. ToUInt16 (STR [0]).
The DataInput_KeyBoardLocation. The Text is such as "0245078" string
Report error is as follows: Detailed information about how to call, please refer to this message at the end of the Real-time debugging (JIT) instead of the dialog box,
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * System, FormatException: the format of the input string is not correct,
em System. Number. StringToNumber (String STR, NumberStyles options, NumberBuffer& The number of NumberFormatInfo info, Boolean parseDecimal) Em System. Number. ParseUInt32 (String value, NumberStyles options, NumberFormatInfo numfmt) Em System. UInt16. Parse (String s, NumberStyles style, NumberFormatInfo info) Em System. The Convert. ToUInt16 (String value) Em TGUS. Touch. DataInput_KeyBoardSet_Click (Object sender, EventArgs e) na e: \ Touch cs: linha 4808 [code=csharp]
[/code] Above suggests that string format is wrong, but in win 7 above can run normally, no errors, change the win 10 computer wouldn't work, and not every win 10 computers is so, some can, some not.
CodePudding user response:
Have a great god know? Very urgent, for several days, have not been solved
CodePudding user response:
I doubt you input the Chinese comma (or Chinese characters) and win10 has nothing to do.
CodePudding user response:
You are not the correct split, Is the Convert. ToUInt16 (STR [0]) error