I am trying to get input from user by using Microsoft.VisualBasic.dll
. Then convert the input from [string] to [char] type. But it gives me this error when I run the code:
*An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code
String must be exactly one character long.*
Sample code:
string directions = Microsoft.VisualBasic.Interaction.InputBox("1 = Buy, 2 = Sell", "Select side", "Default", 700, 400);
char direction = System.Convert.ToChar(directions);
Any idea how to solve this? Thanks in advance.