- meta_tag_generator_demo.zip
- About.cs
- About.Designer.cs
- About.resx
- bin
- Debug
- MetaTagGenerator.exe
- MetaTagGenerator.pdb
- MetaTagGenerator.vshost.exe
- WindowsApplication1.vshost.exe
- Release
- MetaTagGenerator.exe
- MetaTagGenerator.pdb
- Form1.cs
- Form1.Designer.cs
- Form1.resx
- MetaTagGenerator.csproj
- MetaTagObj.cs
- obj
- Debug
- MetaTagGenerator.csproj.GenerateResource.Cache
- MetaTagGenerator.exe
- MetaTagGenerator.frmAbout.resources
- MetaTagGenerator.frmMainForm.resources
- MetaTagGenerator.pdb
- MetaTagGenerator.Properties.Resources.resources
- Refactor
- TempPE
- Properties.Resources.Designer.cs.dll
- MetaTagGenerator.csproj.FileList.txt
- Release
- MetaTagGenerator.csproj.GenerateResource.Cache
- MetaTagGenerator.exe
- MetaTagGenerator.frmAbout.resources
- MetaTagGenerator.frmMainForm.resources
- MetaTagGenerator.pdb
- MetaTagGenerator.Properties.Resources.resources
- Refactor
- TempPE
- Properties.Resources.Designer.cs.dll
- Program.cs
- Properties
|
using System;
using System.Collections.Generic;
using System.Text;
namespace MetaTagGenerator
{
class MetaTagObj
{
private string title;
private string desc;
private string keys;
private string author;
private string distribution;
private string revisit;
public string Title
{
get { return title; }
set { title = value.Trim(); }
}
public string Desc
{
get { return desc; }
set { desc = value.Trim(); }
}
public string Keys
{
get { return keys; }
set { keys = value.Trim(); }
}
public string Author
{
get { return author; }
set { author = value.Trim(); }
}
public string Distribution
{
get { return distribution; }
set
{
if (value.Trim() == "")
{
distribution = "Global"; //default value
return;
}
distribution = value.Trim();
}
}
public string Revisit
{
get { return revisit + " Days"; }
set
{
if (value.Trim() == "")
{
revisit = "10";
return;
}
revisit = value.Trim();
}
}
public MetaTagObj(): this("Title here", "Description Here", "", "", "", "")
{
}
public MetaTagObj(string title, string desc, string keys, string author, string distribution, string revisit)
{
Title = title;
Desc = desc;
Keys = keys;
Author = author;
Distribution = distribution;
Revisit = revisit;
}
public override string ToString()
{
string MetaTag = "";
MetaTag += "<title>"+ Title + "</title>" + Environment.NewLine;
MetaTag += "<meta name=\"description\" content=\"" + Desc + "\" />" + Environment.NewLine;
MetaTag += "<meta name=\"keywords\" content=\"" + Keys + "\" />" + Environment.NewLine;
MetaTag += "<meta name=\"author\" content=\"" + Author + "\" />" + Environment.NewLine;
MetaTag += "<meta name=\"distribution\" content=\"" + Distribution + "\" />" + Environment.NewLine;
MetaTag += "<meta name=\"revisit-after\" content=\"" + Revisit + "\" />" + Environment.NewLine;
return MetaTag;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.