In my Web Application Project, I wanted to read some CSS styles in from a file to dynamically style a system generated email.
It was pretty easy, but I thought I should record my code for future:
Dim emailCss As String = vbNullString
Dim fileName As String = HttpContext.Current.Server.MapPath("~/utilities/Email.css")
If File.Exists(fileName) Then
Dim ioFile As New StreamReader(fileName)
emailCss = ioFile.ReadToEnd()
ioFile.Close()
End If
0 comments:
Post a Comment