/// <summary>
/// 显示信息
/// </summary>
/// <param name="txtInfo"></param>
/// <param name="Info"></param>
public static void ShowInfo(System.Windows.Forms.TextBox txtInfo, string Info)
{
string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string info = string.Empty;
if (Info.Length > 10)
{
info = "" + time + " " + "报告单编号为【" + Info + "】的记录上传成功!";
}
else
{
info = "" + time + " " + "机构编号为【" + Info + "】的记录上传成功!";
}
txtInfo.AppendText(info);
txtInfo.AppendText(Environment.NewLine);
txtInfo.ScrollToCaret();
}
/// <summary>
/// 显示信息
/// </summary>
/// <param name="txtInfo"></param>
/// <param name="Info"></param>
public static void ShowInfo(System.Windows.Forms.TextBox txtInfo, string Info, string ex)
{
string time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string info = string.Empty;
if (Info.Length>10)
{
info = "" + time + " " + "报告单编号为【" + Info + "】的记录上传失败!(" + ex + ")";
}
else
{
info = "" + time + " " + "机构编号为【" + Info + "】的记录上传失败!(" + ex + ")";
}
txtInfo.AppendText(info);
txtInfo.AppendText(Environment.NewLine);
txtInfo.ScrollToCaret();
}
程序打印日志到TextBox
最新推荐文章于 2024-02-27 16:40:00 发布
