如何檢查程式是否已經安裝和安裝的目錄在那裡?
問題來自本站留言板:
■ 請問如何
++ [mh]IcePalm (幼稚園生) ∼第1篇∼
--------------------------------------------------------------------------------
很多時候安裝一些遊戲或software都會有autorun.exe
執行後會有play,install,uninstall等等選擇
請問如何用vb察出一個可以偵察電腦安裝了一個software或安裝左那裡呢??
(203.186.38.121).. 2001/7/21(Sat) 00:54 [#333]
--------------------------------------------------------------------------------
++ 副站長 (小學校低學年) ∼第9篇∼
寫入登錄,
eg.HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\softwere name
(imsbbcache01.netvigator.com).. 2001/7/21(Sat) 12:33 [#335]
++ [mh]IcePalm (幼稚園生) ∼第3篇∼
請問怎樣寫入呢??
可以作詳細解釋嗎??
(203.186.67.3).. 2001/7/21(Sat) 13:41 [#336]
++ 德本立 (平社員) ∼第135篇∼
Option Explicit
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Dim f As Integer
Dim Flag As Boolean
Private Sub Form_Load()
Dim Dict As String
If Dir(WinPath & "\MyProgram.dat") = "" Then
MsgBox "本程式是第一次安裝"
Flag = False
Else
f = FreeFile
Open WinPath & "\MyProgram.dat" For Input As #f
Input #f, Dict
Close #f
MsgBox "本程式安裝在" & Dict & "目錄之下"
Flag = True
End If
End Sub
Private Function WinPath() As String
Dim WL As Long
Dim tmpPath As String * 255
WL = GetWindowsDirectory(tmpPath, 255)
WinPath = Left(tmpPath, WL)
End Function
Private Sub Form_Unload(Cancel As Integer)
If Flag = True Then End
f = FreeFile
Open WinPath & "\MyProgram.dat" For Output As #f
Write #f, App.Path
Close #f
End Sub
(imsbbcf09b.netvigator.com).. 2001/7/22(Sun) 11:17 [#339]