Guidance
指路人
g.yi.org
software / rapidq / Examples / File & Directory / GetShortPathName.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'From:  taplang Fri Dec 13, 2002  10:23 am
' Get shortname

     DECLARE FUNCTION GetShortPathName LIB "kernel32" _
      ALIAS "GetShortPathNameA"(BYVAL lpszLongPath AS STRING, _
      BYVAL lpszShortPath AS LONG, BYVAL lBuffer AS LONG) AS LONG

     filePath$ = STRING$(100,0)
     INPUT "Long filename: ", longFileName$
     FilenameLength = GetShortPathName(longFileName$,VARPTR(filepath$),99)
     shortFileName$ = LEFT$(filepath$,FilenameLength)
     PRINT shortFileName$
     INPUT A

'filePath$ is a null-terminated string that you reserve as your
'container

'longFileName$ is supplied by the user. It must include the full path.
'Besides manual input through INPUT, you can also use QOPENDIALOG to
'get the full path and full file name.

'lBuffer in the API declaration must always be less than the number of
'nulls that you reserved through STRING$
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2024-4-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-12-13 19:39:27