Na uverejňovanie častí zdrojových kódov nám dobre poslúži plugin Syntax Highlighter for WordPress.
Plugin na stahnutie:
http://wordpress.org/extend/plugins/syntax-highlighter/
Domovská stránka:
http://profiles.wordpress.org/users/wokamoto/
Príklad:
static void Convert(string path, string path2, string codepage)
{
byte[] buffer = File.ReadAllBytes(path);
if (buffer.Length > 2)
{
if (buffer[0] != 0xef && buffer[0] != 0xbb)
{
byte[] buffer2 = Encoding.Convert(Encoding.GetEncoding(codepage), Encoding.UTF8, buffer);
byte[] utf8 = new byte[] { 0xef, 0xbb, 0xbf };
FileStream fs = File.Create(path2);
fs.Write(utf8, 0, utf8.Length);
fs.Write(buffer2, 0, buffer2.Length);
fs.Close();
}
}
}
E-mail
RSS

Publikované v kategóriách 

