Visual Basic 无法识别 Path.GetFileName 方法 [英] Visual Basic not recognizing Path.GetFileName Method

查看:26
本文介绍了Visual Basic 无法识别 Path.GetFileName 方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注这个页面,试图在我的Visual Basic 应用程序.当我开始键入Path"时,Visual Studio 2010 IDE 无法识别 Path.GetFileName.如何让 Visual Studio 2010 识别 Path.GetFIleName 方法?

这里是微软官方页面.

解决方案

您是否可能没有引用 System.IO 命名空间?如果您键入 System.IO.Path.那么它工作吗?如果是这样,请保留它,或将 Imports System.IO 添加到文件顶部.

<前>进口系统.IO模块模块1子主()Dim x As String = Path.GetFileName("")结束子终端模块

I am following this page in trying to get the filename in my Visual Basic application. When I start to type 'Path', the Visual Studio 2010 IDE does not recognize Path.GetFileName. How do I get Visual Studio 2010 to recognize the Path.GetFIleName method?

Here is the official Microsoft page.

解决方案

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

这篇关于Visual Basic 无法识别 Path.GetFileName 方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆