دستوري كه بتونه بگه windows روی چه درایوی هست
![]()
دستوري كه بتونه بگه windows روی چه درایوی هست
![]()
منظورت اينه؟
Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
سلامنوشته شده توسط dj farbod
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Private Sub Getpath_WINDOWS()
Dim WindirS As String * 255 'declares a full lenght string for DIR name
'_(for getting the path)
Dim TEMP 'a temporarry variable that holds LENGHT OF THE FINAL PATH STRING
Dim Result 'a variable for holding the the output of the function
TEMP = GetWindowsDirectory(WindirS, 255) 'holds the FUUL(include unneccessary charecters)Path
Result = Left(WindirS, TEMP) 'holds final path
End Sub
Private Sub Getpath_SYSTEM()
Dim WindirS As String * 255 'declares a full lenght string for DIR name(for getting the path)
Dim TEMP 'a temporarry variable that holds LENGHT OF THE FINAL PATH STRING!
Dim Result 'a variable for holding the the output of the function
TEMP = GetSystemDirectory(WindirS, 255) 'holds the FUUL(include unneccessary charecters)Path
Result = Left(WindirS, TEMP) 'holds final path
End Sub
Private Sub getpath_TEMP()
'this API(TEMP) is different from others(in placing arguments)
Dim WindirS As String * 255 'declares a full lenght string for DIR name(for getting the path)
Dim TEMP 'a temporarry variable that holds LENGHT OF THE FINAL PATH STRING!
Dim Result 'a variable for holding the the output of the function
TEMP = GetTempPath(255, WindirS) 'holds the FUUL(include unneccessary charecters)Path
Result = Left(WindirS, TEMP) 'holds final path
End Sub
کد:برای مشاهده محتوا ، لطفا وارد شوید یا ثبت نام کنید
هم اکنون 1 کاربر در حال مشاهده این تاپیک میباشد. (0 کاربر عضو شده و 1 مهمان)