0

我有以下 VB 函数,它将 FileInfo 对象作为参数:

Public Shared Shadows Sub Start(ByVal filePath As FieldInfo)
XmlConfigurator.ConfigureAndWatch(New System.IO.FileInfo(filePath.ToString()))

End Sub

在另一个类中,我有以下代码调用该“开始”方法。但是 VisStudio 表明我传递的“FilePath”参数存在问题。提前致谢!

'Initialize FileInfo object to pass to Start method
        Dim path As String =             Dim filePath As FileInfo = New FileInfo(path)

        LoggingManager.Start(**FilePath**)
4

1 回答 1

0

看起来你错误地声明了 Start 函数,它应该是 FileInfo 而不是 FieldInfo

Public Shared Shadows Sub Start(ByVal filePath As FileInfo)
    XmlConfigurator.ConfigureAndWatch(filePath)
End Sub
于 2011-10-12T21:39:47.147 回答