FileInfo:将 FileInfo 参数传递给方法
我有以下 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**)
I have the following VB function which takes a FileInfo object as a parameter:
Public Shared Shadows Sub Start(ByVal filePath As FieldInfo)
XmlConfigurator.ConfigureAndWatch(New System.IO.FileInfo(filePath.ToString()))
End Sub
In another class I have the following code calling that 'Start' method. But VisStudio indicates there is a problem with the 'FilePath' argument that I'm passing. Thanks in advance!
'Initialize FileInfo object to pass to Start method
Dim path As String = Dim filePath As FileInfo = New FileInfo(path)
LoggingManager.Start(**FilePath**)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来你错误地声明了 Start 函数,它应该是 FileInfo 而不是 FieldInfo
It looks like you mis-declared the Start function, it should be FileInfo not FieldInfo