Is it possible that you're not referencing the System.IO namespace? If you type System.IO.Path. does it then work? If so, keep that, or add Imports System.IO to the top of your file.
Imports System.IO
Module Module1
Sub Main()
Dim x As String = Path.GetFileName("")
End Sub
End Module
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…