Detail Article

Fungsi untuk Mendapatkan Posisi direktory system Windows

--- Letakkan di module
Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" _
  (ByVal lpBuffer As String, ByVal nSize As Long) As Long
'--- Akhir Letakkan di module

Public Function GetSysDir() As String
   Dim boolRetVal As Boolean, lpBuffer As String, nSize As Long
   lpBuffer = Space(255):    nSize = 254
   boolRetVal = GetSystemDirectory(lpBuffer, nSize)
   GetSysDir = StripNullTerminator(lpBuffer)
End Function

Function StripNullTerminator(lpBuffer As String) As String
   Dim I As Integer
   For I = 1 To 255
       If Asc(Mid(lpBuffer, I, 1)) = 0 Then
           lpBuffer = Left(lpBuffer, I - 1)
           Exit For
       End If
   Next I
   StripNullTerminator = lpBuffer
End Function

Private Sub Form_Load()
   MsgBox GetSysDir
End Sub

AbelPutra.com

Perusahaan jasa pembuatan software, pembuatan aplikasi Android, Jasa design website dengan harga bersaing dan After Sales Service terbaik.

Opening Hours:

Mon – Fri : 10AM – 5PM

Sat - Sun : Closed

Get In Touch

Jelambar Selatan XVII-H Blok E No. 2B, Jakarta Barat

+628131485-5566 / +62816-1453-999

[email protected]

© AbelPutra.com 2024, Designed by HTML Codex