C#搜索优化工具
由于静态网页容易被搜索引擎抓取,所以可以把动态网站内的内容的所有目录存为静态HTML(个人见解),下面提供点代码是用已经存在的文件制作网页的:
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace HTNL
{
class Program
{
static void Main(string[] args)
{
string[] filelist = Directory.GetFiles(Directory.GetCurrentDirectory());
StreamWriter sw = File .AppendText ("seo.html");//写目标网页文件
char yh = '"';
foreach(string fl in filelist )
{
string ws = "<A HREF=" + yh + fl + yh + ">" + fl + "</A><br />";
sw.WriteLine(ws);
}
sw.Close();
}
}
}