未声明Filename变量 [英] Filename variable not declared

查看:96
本文介绍了未声明Filename变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨! 

观察下面的代码片段。最后一行显示"Filename = Dir(path)"    "文件名"以前没有声明过。是"文件名"吗?保留字?或者,是"使用此单个
最后一行声明和初始化文件名​​?谢谢! -   John 

Observe the below snippet of code. The last line which says "Filename = Dir(path)"    "Filename" is not previously declared. Is "Filename" a reserved word? Or, is "Filename declared and initialized with this single last line? Thanks! -  John 

推荐答案

您好

如果想要使用'文件名',您需要声明它。

If want to use 'Filename' you would need to declare it.

例如,Dim文件名为string = folderPath& " * .stp"

For example, Dim Filename as string = folderPath & "*.stp"

更好的是,也许  Dim Filename As String = IO.Path.Combine(folderPath," * .stp")会更好。

Better still, maybe  Dim Filename As String = IO.Path.Combine(folderPath, "*.stp") would be better.

你想要实现什么,因为我认为你可能走错了路。您是否要列出目录中的all.stp文件?

What are you trying to achieve, as I think you may be on the wrong track. Are you wanting to list all.stp files from a directory?


这篇关于未声明Filename变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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