我有一个字典,其中包含各种字符串,包括带美元符号的字符串数字。我试图添加两个标签在一起,但显然是“$”不会解析。我使用try和catch:
try
{
int total = 0;
total = int.Parse(priceLabel.Text) + int.Parse(totalLabel.Text);
totalLabel.Text = total.ToString();
}
catch
{
MessageBox.Show("Error");
}
我不知道如何得到它的工作,priceLabel是具有“$” attacthed之一。
完全同样的问题昨天。 – Rob
我寻找这样的问题,并没有看到任何 – KobiashiMaru