mas,
kalo cuman file *.ini saja yang ingin diakses
itu sama saja dengan mengakses file teks biasa.
karena file *.ini kan sebenarnya file teks biasa.

mungkin bisa belajar cara baca/tulis file teks
banyak contoh kok di milis ini tinggal di download

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Ari Firman
Sent: Thursday, July 07, 2005 2:19 PM
To: [email protected]
Cc: [EMAIL PROTECTED]
Subject: Re: [Programmer-VB] Mengolah ini file


dayat wrote:

> Hai teman2,
>
> Ada yang tau gimana cara mengakses file ber-extention *.ini (file 
> konfigurasi aplikasi, dll) gak? aku kebingungan, soalnya baru belajar 
> VB.
>
> gimana cara write, read disetiap bagian dan sub bagian dari data file 
> ini. terimakasih yah!
>
> --
> dayat
>
>
> Untuk keluar dari millis ini, kirim email kosong ke: 
> [EMAIL PROTECTED]
>
>
>
>
> ----------------------------------------------------------------------
> --
> YAHOO! GROUPS LINKS
>
>     *  Visit your group "Programmer-VB
>       <http://groups.yahoo.com/group/Programmer-VB>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        [EMAIL PROTECTED]
>       
> <mailto:[EMAIL PROTECTED]>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ----------------------------------------------------------------------
> --
>
saya coba jawab ya...
kalo salah tolong betulin ya (namanya juga lagi coba-coba maklum...) oh
ya contoh ini saya gunakan pada file WIN.INI lho...

pake Read fungsi API ya...
Tambahkan perintah ini pada Modul Project

Declare Function GetProfileInt Lib "Kernel32.dll" Alias "GetProfileIntA"

(ByVal lpAppName As String, ByVal lpKeyName As String, ByVal nDefault As

Long) As Long
Declare Function GetProfileString Lib "Kernel32.dll" Alias 
"GetProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As 
String, ByVal lpDefault As String, ByVal lpReturnedString As String, 
ByVal nSize As Long) As Long

Penggunaan pada aplikasi sbb..

Private Sub Command1_Click()
Dim ret As Byte
ret = GetProfileInt("Desktop", "WallpaperStyle", -1)
If ret = -1 Then
 
Else
    MsgBox "Nilai [Desktop] WallpaperStyle : " & Str(ret)
End If
End Sub

Private Sub Command2_Click()
Dim buffer As String * 255
Dim x As Byte
x = GetProfileString("Desktop", "Wallpaper", "(error)", buffer, 255)
tulis = Left(buffer, x) If tulis = "(error)" Then

Else
    MsgBox "Path Wallpaper = " + tulis, , "Contoh2"
End If
End Sub


Buat Write Sbb....

Modulnya seperti ini...
Declare Function WriteProfileString Lib "kernel32.dll" Alias 
"WriteProfileStringA" (ByVal lpszSection as String, ByVal lpszKeyName as

String, ByVal lpszString as String) as Long

pada aplikasi sbb....


Private Sub Command3_Click()
Dim x As Byte
  x = WriteProfileString("Desktop", "Wallpaper", "C:\Windows\Blue
lace.bmp") If x = 0 Then
 
Else
    MsgBox "Wallpaper Berubah menjadi Blue lace.bmp", ,"Contoh Write1"
End If End Sub

Selamat mencoba....
Salam


[EMAIL PROTECTED]



Untuk keluar dari millis ini, kirim email kosong ke:
[EMAIL PROTECTED]

 
Yahoo! Groups Links



 




<-----------------------------------------------------------------------
---->



Untuk keluar dari millis ini, kirim email kosong ke:
[EMAIL PROTECTED]

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Programmer-VB/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Kirim email ke