我有以下VB函数,它将FileInfo对象作为参数:
Public Shared Shadows Sub Start(ByVal filePath As FieldInfo)
XmlConfigurator.ConfigureAndWatch(New System.IO.FileInfo(filePath.ToString()))
End Sub
在另一个类中,我有以下代码调用'Start'方法。但VisStudio表明我传递的'FilePath'参数存在问题。提前谢谢!
'Initialize FileInfo object to pass to Start method
Dim path As String = Dim filePath As FileInfo = New FileInfo(path)
LoggingManager.Start(**FilePath**)
答案 0 :(得分:0)
看起来您错误地声明了Start函数,它应该是FileInfo而不是FieldInfo
Public Shared Shadows Sub Start(ByVal filePath As FileInfo)
XmlConfigurator.ConfigureAndWatch(filePath)
End Sub