muktesh

muktesh

  • NA
  • 11
  • 0

How to display own html in Internet explorer using C#?

Oct 9 2008 2:35 AM
In my form there are two button( button1 and button2 ).

using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
     System.Diagnostics.Process.Start(@"http://www.google.com");
    //This code works well.This code will open Internet explorer and Navigate to google site.
        }
        private void button2_Click(object sender, EventArgs e)
        {

        }       
    }
}

I want when button2_Click is clicked the Internet explorer open this page(<html><head><title>Test</title></head><body>Hello world</body></html>) which will be written in
button2_Click.

I am new to C# so plz give me the full code of [form1.cs] for this program.

Answers (2)