Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use VB.NET file system objects

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to use VB.NET file system objects, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!

We often deal with file systems, and with the introduction of VB.NET file system objects, everything becomes much easier. To apply the FSO object, you reference a type library named Scripting by executing the VB6.0 menu item Project / reference and adding a reference to the MicrosoftScriptingRuntime item in the list box. Then we can see many objects and their methods and properties under the Scripting type library in the object browser.

1Participate VB.NET file system object to get the system folder path:

\ 'return Windows folder path FunctionGetWindir () DimFsoAsNewFileSystemObject GetWindir=Fso.GetSpecialFolder (WindowsFolder) SetFso=Nothing EndFunction\' return Windows\\ System folder path FunctionGetWinSysdir () DimFsoAsNewFileSystemObject GetWinSysdir=Fso.GetSpecialFolder (SystemFolder) SetFso=Nothing EndFunction

2Synthetical application of file system objects in VB.NET: a general process of file backup:

\ 'Filename= file name, Drive= drive, Folder= folder (tier 1) SubBackupFile (FilenameAsString,DriveAsString,FolderAsString) DimFsoAsNewFileSystemObject\' create FSO object instance DimDest_pathAsString,CounterAsLong Counter=0 DoWhileCounter

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report