大家好日子。我的问题很容易认识,但我不知道。问题在于代码
object value = vr.ReadTypedValue();
Console.WriteLine("{0}({1},{2}):{3}", vr.NodeType, vr.Name, value.GetType().Name, value);
我想写vr.NodeType,vr.Name,value.GetType()。在其中给MessageBox.Show命名信息。我该怎么办?如何修改这段代码来解决我的问题
答案 0 :(得分:1)
在控制台应用中:
添加
System.Windows.Forms.dll //Ty Alex
到您的项目并添加winforms代码。
MessageBox.Show(string.Format("{0}({1},{2}):{3}",
vr.NodeType,
vr.Name,
value.GetType().Name,
value));
消息框代码
MessageBox.Show("this shows a messagebox");
格式代码
string.Format("This line formats a {0} with the given {1}","string", "params");
答案 1 :(得分:1)
格式化邮件
string message = String.Format("{0}({1},{2}):{3}",
vr.NodeType, vr.Name, value.GetType().Name, value);
并在MessageBox
中显示:
MessageBox.Show(message);
答案 2 :(得分:0)
object value = vr.ReadTypedValue();
string message = string.Format("{0}({1},{2}):{3}", vr.NodeType, vr.Name, value.GetType().Name, value);
System.Windows.Form.MessageBox.Show(message);