ue4 查找文件夹内文件夹
知道用户桌面或其“我的文档”文件夹的路径通常很有用。 问题在于用户可以更改这些文件夹路径。 但是,windows内置了对访问这些值的支持。 此处的功能将使您轻松获得该信息。
无论用户计算机上的语言设置如何,这也将起作用(这很重要,因为这会影响某些文件夹(如“我的文档”)的命名。
Public Function SpecialFolderPath(strFolder As String) As String
' Find out the path to the passed special folder. User on of the following arguments:
' Options For specical folders
' AllUsersDesktop
' AllUsersStartMenu
' AllUsersPrograms
' AllUsersStartup
' Desktop
' Favorites
' Fonts
' MyDocuments
' NetHood
' PrintHood
' Programs
' Recent
' SendTo
' StartMenu
' Startup
' Templates
On Error GoTo ErrorHandler
'Create a Windows Script Host Object
Dim objWSHShell As Object
Set objWSHShell = CreateObject("WScript.Shell")
'Retrieve path
SpecialFolderPath = objWSHShell.SpecialFolders(strFolder & "")
' Clean up
Set objWSHShell = Nothing
Exit Function
'**************************************
'* Error Handler
'**************************************
ErrorHandler:
MsgBox "Error finding " & strFolder, vbCritical + vbOKOnly, "Error"
End Function
翻译自: https://bytes.com/topic/access/insights/933853-find-users-special-folders-such-desktop-my-documents
ue4 查找文件夹内文件夹