Reputation: 5
When i use this code:
Dim sessionid = "sessionid = " + """" + TextBox2.Text + """"
Dim steamlogin = "steamLogin = " + """" + TextBox3.Text + """"
Dim steamparental = "steamparental = " + """" + """"
Dim sortextera = "sort = " + """" + """"
MsgBox(SettingsDir, sessionid + steamlogin + steamparental + sortextera, True)
Visual Basics comes up with an error saying it can't convert this to a string. Any help?
Upvotes: 0
Views: 70
Reputation: 460208
MsgBox
expects a MsgBoxStyle
as the second parameter, not a string. So this should work:
MsgBox(SettingsDir, MsgBoxStyle.Information, sessionid + steamlogin + steamparental + sortextera)
(i also don't know the purpose for the boolean as last parameter)
I also prefer:
MessageBox.Show
instead of the VB6 MsgBox
to be .NET compatible&
instead of +
for string concatenation because &
is defined exclusively for strings as opposed to +
and reduces your chances of generating an unintended conversionusing String.Format
to format strings:
Dim message = String.Format("sessionid = ""{0}"" steamLogin = ""{1}"" steamparental = ""{2}"" sort = ""{3}""",
TextBox2.Text, TextBox3.Text, "", "")
Upvotes: 5