“未处理格式异常";在vb.net中 [英] "Format Exception was Unhandeled" in vb.net

查看:86
本文介绍了“未处理格式异常";在vb.net中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码中的错误在哪里

What is wrong here in the code

 Dim sReaderList As String
sReaderList = New System.String(vbNullChar, 2048)
      

       Dim x As Integer = Convert.ToInt32(sReaderList)




调试时会产生未处理格式异常"
并且vb.net




When debug it produce "Format Exception was Unhandeled"
and Input string was not in a correct format in vb.net

推荐答案

中的输入字符串格式错误,您正在尝试将2048个NULL字符的字符串转换为整数值.当然,这将是一个例外.您要达到什么目的?
You are trying to convert a string of 2048 NULL characters to integer value. Of course it would give an exception. What are you trying to achieve?


这篇关于“未处理格式异常";在vb.net中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆