"system.io.fileinfo"的操作; [英] operation of "system.io.fileinfo"

查看:96
本文介绍了"system.io.fileinfo"的操作;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的编码中,我无法识别编码中的"dirinfo"一词,请提供示例指导我

here in the below coding i cant able to identify the "dirinfo " term in the coding kindly guide me with a sample

For Each fi As System.IO.FileInfo In dirInfo.GetFiles("*.doc")
'  dirInfo : is the directory where all the separate docs are saved

推荐答案

此处 [ ^ ]是MSDN页面DirectoryInfo类.该页面上有一个很好的示例,说明了如何使用它.您应该将 MSDN主页标记为 [
Here[^] is the MSDN page for DirectoryInfo class. This page has an excellent example on how to use it. You should book mark the MSDN Homepage[^] for future reference, and your first option, if you don''t know how to do something, should always be to open that page and search for what you need. You will learn things much quicker that way, as well as learning the proper way to do things.

Hope it helps you.


这很简单:您需要查看在For Each语句之前执行的行.
某个地方将有相当于:
It''s simple: you need to look at the lines that are executed before the For Each statement.
Somewhere there will be the equivalent of:
Dim dirInfo As New DirectoryInfo(path)


更重要的是,GetFiles返回字符串数组,因此无论如何您都不能使用该代码中所示的for each.
More to it, GetFiles returns string array, so you cannot use for each as shown in that code anyway.


这篇关于"system.io.fileinfo"的操作;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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