Hack Forums
[C#] Basic HyperText Markup Language Editor [C#] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] Basic HyperText Markup Language Editor [C#] (/showthread.php?tid=695618)



Basic HyperText Markup Language Editor [C#] - Pulser - Sep 23, 2010

I apologize this thread got posted twice on accident.

Hello hackforums,

I made this little application as a way to help people understand the Save File dialog and the Open file dialog. Its also an easy way to create a web page!

What is HTML?
HTML, which stands for HyperText Markup Language, it is the predominant markup language for web pages. It is written in the form of HTML elements consisting of "tags" surrounded by angle brackets within the web page content. It is the building blocks of all basic websites.

Thanks to Wiki for this simplistic definition.

What does this program do?
This program will allow you to save and open web pages. There is also an option of inserting the basic HTML structure tags including:
-HTML
-Body
-Head
-Title
-Comment

Pictures!

[IMG]http://i56.[censored].com/s1j01w.jpg[/IMG]
[IMG]http://i52.[censored].com/2vn0ygj.jpg[/IMG]

Download / Scan

http://www.multiupload.com/76106ZTYCQ

Scan:
Spoiler (Click to View)

Source:
Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;

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

  private void button1_Click(object sender, EventArgs e)
  {

  }

  private void saveWebpageToolStripMenuItem_Click(object sender, EventArgs e)
  {
    string Saved_File = "";

    saveFD.InitialDirectory = "C:/";
    saveFD.Title = "Please Save Your Webpage";
    saveFD.FileName = "";

    saveFD.Filter = "HTML Files|*.htm|All Files|*.*";

    if (saveFD.ShowDialog() != DialogResult.Cancel)
    {
    Saved_File = saveFD.FileName;
    richTextBox1.SaveFile(Saved_File, RichTextBoxStreamType.PlainText);

    }
  }

  private void insertStructureTagsToolStripMenuItem_Click(object sender, EventArgs e)
  {

    string structuretags = "<html>\r\n<head>\r\n\r\n<!--\r\nauthor\r\n-->\r\n<title>\r\n\r\n</title>\r\n</head>\r\n<body>\r\n\r\n\r\n</body>\r\n</html>";
    richTextBox1.Text = (richTextBox1.Text + structuretags);
  }

  private void openToolStripMenuItem_Click(object sender, EventArgs e)
  {
    string webpage = "";

    openFD.InitialDirectory = "C:";
    openFD.Title = "Please Open a Source";

    openFD.FileName = "";
    openFD.Filter = "HTML|*.html|All Files|*.*";

    openFD.ShowDialog();

    webpage = openFD.FileName;

    richTextBox1.Text = File.ReadAllText(webpage.ToString());

  }

  private void Form1_Load(object sender, EventArgs e)
  {

  }
    }
}

This is indeed a basic program but I'm sure someone will find use for it!