Vb.net 子字符串的整数分析-输入字符串的格式不正确

Vb.net 子字符串的整数分析-输入字符串的格式不正确,vb.net,parsing,integer,substring,steam,Vb.net,Parsing,Integer,Substring,Steam,好久不见了。我正试图快速地总结一些代码,但在Dim num2行中,我发现输入字符串的格式不正确,因为Integer=Integer.Parse(streamid32.Substring(8,9))。我认为我没有做错什么。数字这里实际上是数字,只是隐藏了我的公共ID Dim SteamID32 As String = "STEAM_0:0:numbershere" Dim num1 As Integer = Integer.Parse(SteamID32.Substring(10

好久不见了。我正试图快速地总结一些代码,但在Dim num2行中,我发现输入字符串的格式不正确,因为Integer=Integer.Parse(streamid32.Substring(8,9))。我认为我没有做错什么。数字这里实际上是数字,只是隐藏了我的公共ID

    Dim SteamID32 As String = "STEAM_0:0:numbershere"

    Dim num1 As Integer = Integer.Parse(SteamID32.Substring(10))
    Dim num2 As Integer = Integer.Parse(SteamID32.Substring(8, 9))

    Dim UserID32 As Integer = (num1 * 2) + num2

    Label1.Text = "U:1:" + UserID32.ToString

您需要为
子字符串的第二个参数指定长度,而不是最后一个字符索引:

Dim num2 As Integer = SteamID32.Substring(8, 1)  'num2 = 0'

您需要为
子字符串的第二个参数指定长度,而不是最后一个字符索引:

Dim num2 As Integer = SteamID32.Substring(8, 1)  'num2 = 0'

您需要为
子字符串的第二个参数指定长度,而不是最后一个字符索引:

Dim num2 As Integer = SteamID32.Substring(8, 1)  'num2 = 0'

您需要为
子字符串的第二个参数指定长度,而不是最后一个字符索引:

Dim num2 As Integer = SteamID32.Substring(8, 1)  'num2 = 0'

如果你的问题是这样解决的,考虑接受这个答案:如果你的问题是这样解决的,考虑接受答案:如果你的问题是这样解决的,考虑接受答案:如果你的问题以这样的方式解决的话,请考虑接受答案: