kegunaan foto:
StringWriter textBuffer = StringWriter baru();
Pertandingan cocok= Regex.Match(HTMLStr,@"",RegexOptions.IgnoreCase | RegexOptions.Compiled);
jika(cocok==null)
{
Respon.Write(HTMLStr);
kembali;
}
string codeType = match.Groups["codeType"].Nilai;
string content = match.Groups["codeContent"].Value;
if(codeType==String.Kosong || konten==String.Kosong)
{
Respon.Write(HTMLStr);
kembali;
}
// Kotak Pesan.Tampilkan(Tipe Kode);
// Kotak Pesan.Tampilkan(konten);
string[] sr = konten.Split(Konversi.ToChar("n"));
jika(Tipekode==='C#')
{
textBuffer.Write("<Csharp>rn");
foreach(string sourceLine di sr)
{
textBuffer.Write(FixCSLine(sourceLine)) ;
textBuffer.Write("rn");
}
textBuffer.Write("</Csharp>");
}
lain jika(codeType=="JScript.Net")
{
textBuffer.Write("<JScript.Net>rn");
foreach(string sourceLine di sr)
{
textBuffer.Write(FixJSLine(sourceLine)) ;
textBuffer.Write("rn");
}
textBuffer.Write("</JScript.Net>");
}
lain jika(codeType=="VB")
{
textBuffer.Write("<VB>rn");
foreach(string sourceLine di sr)
{
textBuffer.Write(FixVBLine(sourceLine)) ;
textBuffer.Write("rn");
}
textBuffer.Write("</VB>");
}