I want to generate and output an html file with images using C# winforms. I have a few images in the Resources folder, but I'm not able to output them to html.
Could anyone suggest how to access and output images present in Resources to an html file?
My code:
using System;
using System.Windows.Forms;
using System.IO;
namespace winformToHtml
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btn_report_Click(object sender, EventArgs e)
{
StreamWriter sWrite = new StreamWriter("C:\\report.html");
sWrite.WriteLine("<html>");
sWrite.WriteLine("<body>");
sWrite.WriteLine("<p> <img src= 'Resources/image.png' height='10%' width='5%' > </p>");
sWrite.WriteLine("<body>");
sWrite.WriteLine("<html>");
sWrite.Close();
}
}
}