如何解决以下行中出现的输入字符串错误:
string body = String.Format(
"The following leave request was made by user {o}: \n Date: {1} \t Hours: {2} \t Reason: {3}",
username.ToString(),
TxtBoxDate.Text,
DDHours.SelectedValue+DDTimeWindow.SelectedValue,
TxtNotes.Text);
答案 0 :(得分:16)
看起来你有o
字母而不是零0
。尝试:
string body = String.Format("The following leave request was made by user {0}: \n Date: {1} \t Hours: {2} \t Reason: {3}", username.ToString(), TxtBoxDate.Text, DDHours.SelectedValue+DDTimeWindow.SelectedValue, TxtNotes.Text);
答案 1 :(得分:2)
简单的拼写错误,您使用的是o
而不是0
答案 2 :(得分:2)
只需将'o'更改为'0'(零)。
答案 3 :(得分:2)
你有一个O而不是零{o}
- > {0}
string body =
String.Format(
"The following leave request was made by user {0}: \n Date: {1} \t Hours: {2} \t Reason: {3}",
username.ToString(),
TxtBoxDate.Text,
DDHours.SelectedValue + DDTimeWindow.SelectedValue,
TxtNotes.Text);