如何换行 [英] how to give new line
本文介绍了如何换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我正在与信息发送者合作,我需要C#中的代码
Hi all
I am working with information sender i need code in c#
string Body = "User Name :" + Txt_Name.Text+", " + "Contact No :" ;
为了给予,我们使用,"
我需要给换行加上其他内容,请帮帮我
For giving , we are using ","
What i need to give for New line, and other things please help me
推荐答案
您必须使用break标记
you have to use break tag
<br/>
就像
that is like
string Body = "User Name :" + Txt_Name.Text+ "<br/> " + "Contact No :" ;
您可以在字符串内使用html标签
you can use html tag inside string
string body = "You have received a status update from " + Session["name"].ToString() + ", Department : " + Session["deptt"].ToString() + " ,with reference to Assignment ID: " + lblassno.Text + " /Task ID: " + taskid + ". Kindly login TMS on Intranet Portal to view the details.";
body += "<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><span style="mso-bidi-font-style:normal;font-style: italic;font-size: small;">This is a System generated message,";
body += "kindly do not reply to this.<o:p xmlns:o="#unknown"></o:p></span>";
但请确保何时发送邮件
but ensure when you send mail
MailMessage m = new MailMessage("Omaxe Ltd.<testr@gmail.com>", To);
m.Subject = Subject;
m.Body = Body;
m.IsBodyHtml = true;
Environment.NewLine
使用此
检查此示例
Use This
Check this example
txtEmailBodyDB.Text = "Hi There " + Environment.NewLine + " " + Environment.NewLine + "These are auto genrated Mails.Kindly Ignore these mails. " +
这篇关于如何换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文