我在网上找到了一些代码。它在 C# 中,我正在尝试将其移植到 vb.net。在从 Log 子例程中调用评估器函数时,我需要一些帮助。在 C# 中,评估器在 Log 中调用时似乎不需要任何参数。但是,VB 一直要求 Match 参数。有什么魔力,我应该如何让它在 VB.NET 中工作?谢谢。
private string evaluator(Match match)
{
Pri pri = new Pri(match.Groups[1].Value);
return pri.ToString()+" ";
}
private void Log(EndPoint endPoint, string strReceived)
{
...
string strMessage = string.Format("{0} : {1}",
endPoint, m_regex.Replace(strReceived, evaluator));
...
}