수정코드)
void AddTxtLines(System.Windows.Forms.RichTextBox tmp, string text, int maxLines)
{
if(true)
{
try
{
if(tmp.Lines.Count() >= maxLines)
{
List<string> lines = tmp.Lines.ToList();
lines.RemoveAt(0);
tmp.Lines = lines.ToArray();
}
}
catch(AccessViolationException accexp)
{
Console.WriteLine("[MUSIC_DEBUG]:" + accexp.Message);
}
catch(Exception e)
{
Console.WriteLine("[MUSIC_DEBUG]:" + e.Message);
}
}
try
{
tmp.AppendText(text);
tmp.ScrollToCaret();
}
catch(AccessViolationException accexp)
{
Console.WriteLine("[MUSIC_DEBUG]:" + accexp.Message);
}
catch(Exception e)
{
Console.WriteLine("[MUSIC_DEBUG]:" + e.Message);
}
}