|
Postada em 14/03/2005 18:27 hs
Olá pessoal da VBWEB to com um baita problema aqui. eu fazendo um programinha simples poem eficaz.rs.. Queria saber como fasso para abrir a pasta : Desktop Meus documentos Meus locais de rede. o problema é o seguinte. C:Documents and Settingswilliam nesse caminho ai em cima eu abro a pasta normal mas e quem não tiver o nome de "william" Sera que alguem poderia me ajudar nessa enrrascada? um abraço ae.
|
|
|
|
|
Postada em 15/03/2005 08:26 hs
Use o FileSystemObject, atribuindo uma referência à Microsoft Scripting runtime.
|
|
|
|
Postada em 15/03/2005 09:22 hs
kerplunk vc poderia postar o codigo para mim é quem faz pouco tempo que comecei a mexer com vb. então não manjo quase nada. e esse objeto ele consegue abrir para mim. a pasta de: desktop meus documentos meus locais de rede. assim eu presiva que ele exibisse em um listbox o que tem no desktop. ou no meus documentos meus locais de rede. tenta arrumar uma solução para mim kerplunk. um abraço
|
|
|
|
Postada em 16/03/2005 10:09 hs
O pessoal me ajuda ae.. ou se não me fala um projeto q fassa isso. to no aguardo
|
|
|
|
Postada em 16/03/2005 15:48 hs
não sei se é bem isto que precisa, mas lá vai '-----------no modulo 'these are the api calls needed to get the folder information Public Declare Function SHGetSpecialFolderLocation Lib "Shell32" (ByVal hwnd As Long, ByVal nFolder As Long, Pidl As Long) As Long Public Declare Function SHGetPathFromIDList Lib "Shell32" (Pidl As Long, ByVal FolderPath As String) As Long Const MAX_PATH = 260 'this enumeration holds all of the values accepted 'by the SHGetSpecialFolderLocation call, related to the 'folder name that will be retrieved. Public Enum SystemFolder Desktop = 0 arquivos_de_Programas = 3 StartMenu_Programs = 2 My_Documents = 5 Favorites = 6 Startup = 7 Recent = 8 SentTo = 9 Start_Menu = 11 Windows_Desktop = 16 Network_Neighborhood = 19 Fonts = 20 ShellNew = 21 AllUsers_Desktop = 25 ApplicationData = 26 Printhood = 27 TemporaryInternetFiles = 32 Cookies = 33 History = 34 End Enum Public Function FindSystemFolder(ByVal lngNum As SystemFolder) As String On Error GoTo FindSystemFolder_Err Dim lpStartupPath As String * MAX_PATH Dim Pidl As Long Dim hResult As Long 'find if a folder does exist with that number hResult = SHGetSpecialFolderLocation(0, lngNum, Pidl) If hResult = 0 Then 'there is a result 'get the actualy directory name hResult = SHGetPathFromIDList(ByVal Pidl, lpStartupPath) If hResult = 1 Then 'strip the string of all miscellaneous and unused characters lpStartupPath = Left$(Trim$(lpStartupPath), InStr(lpStartupPath, Chr(0)) - 1) FindSystemFolder = Trim$(lpStartupPath) End If End If FindSystemFolder_End: Exit Function FindSystemFolder_Err: Err.Raise Err.Number, "FindSystemFolder::" & Err.Source, Err.Description End Function '--------- no form Private Sub Command1_Click() destino = FindSystemFolder(Desktop) MsgBox destino End Sub
|
|
|