????? ?????? ??? ??? ??? ???? ?? ??? ??? ????

?????? ????????? ?????? ?????????
???? ???????: 175512 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

??? ???? ????? ?? ???? ?? ??????? ??? ?????? ??? "??? ??? ????" ?????? ?? ??? ?? "??? ??? ????". ?????? ?????? ???? ?? ????? ??? ????? ??? "??? ??? ????" ??????? ???? "??? ??? ????" ???????? ??????? ???? API GetShortPathName.

??????? ????

????? ?????? ????????? ???????? ?????? ???? ???? ???? ????? ????? ??????? ??????? ??? ????????? ??? ???? ?????? ??? ?????? ????? ?????? ????? ??????? ?????? ?????.

???? ???? ?????

  1. ????? ????? EXE ????? ???? ?? Visual Basic. ??? ????? Form1 ???? ???????.
  2. ??? CommandButton ??? Form1.
  3. ?? ???? ???? "???? ???? ????" ?? ???????.
  4. ?? ??????? ????? ? ??? ?????? ??????? ?????? ?????? ????? ????????? ?????? ???? ??? ???????.
  5. ?? ?????? ????????? ???????? ??????? ??? ?????? ??????? 1:
       Declare Function GetShortPathName Lib "kernel32" _
          Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _
          ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
    
       Public Function GetShortName(ByVal sLongFileName As String) As String
           Dim lRetVal As Long, sShortPathName As String, iLen As Integer
           'Set up buffer area for API function call return
           sShortPathName = Space(255)
           iLen = Len(sShortPathName)
    
           'Call the function
           lRetVal = GetShortPathName(sLongFileName, sShortPathName, iLen)
           'Strip away unwanted characters.
           GetShortName = Left(sShortPathName, lRetVal)
       End Function
    					
  6. ?? ?????? ????????? ???????? ??????? ??? Form1:
       Private Sub Command1_Click()
         Dim msg As String
         CommonDialog1.FileName = "*.*"
         CommonDialog1.ShowOpen
         msg = "Long File Name: " & CommonDialog1.filename & vbCrLf
         msg = msg & "Short File Name: " & GetShortName(CommonDialog1.filename)
         MsgBox msg
       End Sub
    					
  7. ????? ??????? ?? ???? ??? ??????? F5. ???? ??? ?? ??? ?????? ???? ?????? ???. ?????? ?? ???? ?????? ??? ? ???? ?? ??? ????? ??? "??? ??? ????". ??? ????? ?? ???? ??? ?????.
  8. ???? ???? ??????? ??? "??? ????" ?? ??? ??? ????.

?????

?????? ??? ???? ?? ?????????? ?????? ?????? ??????? ??????? ?? "????? ??????? ?? Microsoft:
154822????? ?????? ??? ??? ??? ???? ?? ??? ??? ????

???????

???? ???????: 175512 - ????? ??? ??????: 01/???/1426 - ??????: 3.2
????? ???
  • Microsoft Visual Basic Control Creation Edition
  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic 4.0 Standard Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 32-Bit Enterprise Edition
  • Microsoft Visual Basic 6.0 Learning Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
????? ??????: 
kbmt kbdocfix kbhowto KB175512 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????175512

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com