[英]How can I convert this VB.NET code to C#?
如何將VB.NET代碼轉換為C#?
Private myImageMapCalculations As New clsImageMapCalculations(Sub(ex As Exception) UnhandledExceptionHandler())
private clsImageMapCalculations myImageMapCalculations = new clsImageMapCalculations((Exception ex) => UnhandledExceptionHandler());
VB.NET到C#的轉換可以通過轉換工具完成,例如,請參見http://www.developerfusion.com/tools/convert/vb-to-csharp/
這樣的事情應該工作:
private clsImageMapCalculations myImageMapCalculations =
new clsImageMapCalculations((Exception ex) => UnhandledExceptionHandler());
轉換工具可能會造成問題的部分是:
Sub(ex As Exception) UnhandledExceptionHandler()
可以在C#中將其轉換為相應的lambda表達式:
(Exception ex) => UnhandledExceptionHandler()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.