how to add image to html file which is created using file.create method
i am creating html file by using below code
string path = HttpContext.Current.Server.MapPath("Attachments/test.html");
// Delete the file if it exists.
if (File.Exists(path))
{
File.Delete(path);
}
// Create the file.
using (FileStream fs = File.Create(path, 1024))
{
byte[] info = new UTF8Encoding(true).GetBytes("<html><body><div>Test</div></body><html>");
/开发者_如何学编程/ Add some information to the file.
fs.Write(info, 0, info.Length);
}
I want to add a image to this html file... how to add image to this html file.
byte[] info = new UTF8Encoding(true).GetBytes("<html><body><div>Test</div><img src='image.png' alt='your added image'/></body><html>");
精彩评论