Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it L'avatar di daneel
    Registrato dal
    Oct 2002
    Messaggi
    229

    Trasformare path locale in path dos

    Esiste una funzione che trasformi una path locale nella relativa path DOS?

  2. #2
    Utente di HTML.it L'avatar di sebamix
    Registrato dal
    Aug 2000
    Messaggi
    1,028
    codice:
    Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long
    Public Function GetShortPath(strFileName As String) As String
        'KPD-Team 1999
        'URL: http://www.allapi.net/
        'E-Mail: KPDTeam@Allapi.net
        Dim lngRes As Long, strPath As String
        'Create a buffer
        strPath = String$(165, 0)
        'retrieve the short pathname
        lngRes = GetShortPathName(strFileName, strPath, 164)
        'remove all unnecessary chr$(0)'s
        GetShortPath = Left$(strPath, lngRes)
    End Function
    Private Sub Form_Load()
        MsgBox GetShortPath("c:\Program Files\")
    End Sub
    Prova questo (non sono sicuro).


  3. #3
    codice:
    Declare Function GetShortPathName Lib "kernel32" Alias " _
        GetShortPathNameA" (ByVal lpszLongPath As String, _
        ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
    Const PATH_LEN& = 164
    
    Public Function GetShortFileName(ByVal FileName As String) As String
        Dim rc As Long
        Dim ShortPath As String
        ShortPath = String$(PATH_LEN + 1, 0)
        rc = GetShortPathName(FileName, ShortPath, PATH_LEN)
        GetShortFileName = Left$(ShortPath, rc)
    End Function
    Vascello fantasma dei mentecatti nonchè baronetto della scara corona alcolica, piccolo spuccello di pezza dislessico e ubriaco- Colui che ha modificato l'orribile scritta - Gran Evacuatore Mentecatto - Tristo Mietitore Mentecatto chi usa uTonter danneggia anche te

  4. #4
    Utente di HTML.it L'avatar di daneel
    Registrato dal
    Oct 2002
    Messaggi
    229
    Bene così, grazie!

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.