.net设置重点文字颜色为红色
各位:我写了一个发邮件的函数,但是想在重点的文字用红颜色显示,请问如何设置?vb.net
代码如下:
Public Function dsemail2(ByVal mail As String, ByVal file_no As String, ByVal file_name As String, ByVal file_session As String, ByVal file_path As String) As Integer
Dim subjectstr, demostr As String
subjectstr = file_name + "文件新发布"//红色显示
demostr = "您好!" & Environment.NewLine
demostr = demostr & "新文件发布通知,请勿回复!" & Environment.NewLine
demostr = demostr & "<script language =javascript><font color = red>今天新上传了文件,请您查阅!</font></script>" & Environment.NewLine
demostr = demostr & Environment.NewLine & "文件编号:" + file_no
demostr = demostr & Environment.NewLine & "文件名称 :" + file_name
demostr = demostr & Environment.NewLine & "文件版本号:" + file_session
demostr = demostr & Environment.NewLine & "文件路径:" + file_path
demostr = demostr & Environment.NewLine & "以上" & Environment.NewLine
demostr = demostr & " 希望您能抽时间查看!"
'---------------------------------------------------------将员工编号和姓名分开
Dim message As MailMessage = New MailMessage(stremail.ToString, mail, subjectstr, demostr) 'toemail
Dim client As SmtpClient = New SmtpClient(strsmtp.ToString)
client.UseDefaultCredentials = False
client.Credentials = New System.Net.NetworkCredential(stremailuser.ToString, stremailpassword.ToString)
client.DeliveryMethod = SmtpDeliveryMethod.Network
client.Send(message)
Return 1
End Function --------------------编程问答-------------------- subjectstr = file_name + "<font color=red>文件新发布</font>"//红色显示 --------------------编程问答-------------------- 不是这样的,你的方法不对!有高手指点么? --------------------编程问答-------------------- subjectstr它的载体是什么?
它的载体.ForeColor = Color.Red
这样可以不?? --------------------编程问答-------------------- 如果你用的TEXTBOX的话,肯定不行.它是一红俱红地.
你用RichTextBox可以的. --------------------编程问答-------------------- 1 打开系统自带的"写字板"
2 输入"文件新发布"并设置为红色
3 保存RTF
4 用"记事本"打开该RTF,复制所有内容
5 subjectstr = file_name + 复制的内容
补充:.NET技术 , VB.NET