基本信息
源码名称:C# 動態產生網頁檔​
源码大小:0.05M
文件格式:.rar
开发语言:C#
更新时间:2017-01-18
   源码介绍
動態產生網頁檔

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

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

        private void button1_Click(object sender, EventArgs e)
        {
            StreamWriter sw = new StreamWriter("htmlfile.html");
            sw.WriteLine("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
            sw.WriteLine("<html xmlns=\"http://www.w3.org/1999/xhtml\"><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">");
            sw.WriteLine("<title>360 ° View Gallery</title>");
            sw.WriteLine("<body>");
            sw.WriteLine("<p>test html</p>");
            sw.WriteLine("");
            sw.WriteLine("</body>");
            sw.WriteLine("</html>");
            sw.Close();
        }
    }
}