我有一個字典,其中包含各種字符串,包括帶美元符號的字符串數字。我試圖添加兩個標籤在一起,但顯然是「$」不會解析。我使用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