public string TarihFormatla(string tarih) {
return Convert.ToDateTime(tarih).ToShortDateString();
}

public string HtmlTemizle(string metin)
{
metin = Regex.Replace(metin, "<[^>]*>", string.Empty);
metin = metin.Replace("<p>", "");
metin = metin.Replace("</p>", "");
return metin;
}

public string SqlTemizle(String str)
{
String[] badChars = new String[] { ";", "*", "char", "nchar", "varchar", "<script", "</script>", "=", "+", "'", "[", "]", "{", "}", "--", "select", "join", "union", "insert", "delete", "update", "drop", "create", "modify", "rename" };
String tmp = str;
foreach (String strItem in badChars)
{
tmp = tmp.Replace(strItem, "");
}
return tmp;
}

public string VirgulNoktaYap(String str)
{
string tmp = "";
tmp = str.Replace(",", ".");
return tmp;
}

public string RandomUret(int kacbasamak)
{
char[] karakter = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".ToCharArray ();
string result = string.Empty;
Random r = new Random();
for (int i = 0; i < kacbasamak; i++)
{
result += karakter[r.Next(0, karakter.Length - 1)].ToString();
}
return result;
}

public string BenzersizUret()
{
string suan = DateTime.Now.ToString().Replace(":", "").Replace(" ", "").Replace(".", "").Replace("/", "");
suan = suan + "-" + RandomUret(5);
return suan;
}