The sample VB.net code for comparison contains both syntax and logic errors.
In VB.Net, an IF is ended by "End If", not End.
Also, "If result = number * Factorial(number - 1)" is attempted assignment and comparison and produces an incorrect result. If you run this code, you always get zero as a result.
Private Function Factorial(ByVal number As Integer) As Integer
If number = 0 Then
Return (number * Factorial(number - 1))