|
| 29 Apr 2008 03:48:52 am |
blog.medanit.net |
|
|
http://blog.medanit.net
Wadah tempat berbagi informasi mengenai solusi dunia Informasi Teknologi |
|
| |
Category : Links
| By : admin | Comments [0] | Trackbacks [54] |
|
|
| 29 Apr 2008 03:47:14 am |
Medanit |
|
|
www.medanit.net
Sebagai wadah khusus untuk mengatasi solusi dalam bidang Informasi Teknologi |
|
| |
Category : Links
| By : admin | Comments [0] | Trackbacks [0] |
|
|
| 14 Sep 2006 05:06:04 pm |
run and wait pid by shell |
|
|
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Const SYNCHRONIZE = &H100000
Private Const INFINITE = -1&
' Start the indicated program and wait for it
' to finish, hiding while we wait.
Private Sub ShellAndWait(ByVal program_name As String, ByVal window_style As VbAppWinStyle)
Dim process_id As Long
Dim process_handle As Long
' Start the program.
On Error GoTo ShellError
process_id = Shell(program_name, window_style)
On Error GoTo 0
' Hide.
Me.Visible = False
DoEvents
' Wait for the program to finish.
' Get the process handle.
process_handle = OpenProcess(SYNCHRONIZE, 0, process_id)
If process_handle <> 0 Then
WaitForSingleObject process_handle, INFINITE
CloseHandle process_handle
End If
' Reappear.
Me.Visible = True
Exit Sub
ShellError:
MsgBox "Error starting task " & _
txtProgram.Text & vbCrLf & _
Err.Description, vbOKOnly Or vbExclamation, _
"Error"
End Sub
' Start the program.
' Meng eksekusi conmmand shell
Private Sub cmdRun_Click()
Select Case cboShellStyle.Text
Case "vbHide"
ShellAndWait txtProgram.Text, vbHide
Case "vbMaximizedFocus"
ShellAndWait txtProgram.Text, vbMaximizedFocus
Case "vbMinimizedFocus"
ShellAndWait txtProgram.Text, vbMinimizedFocus
Case "vbMinimizedNoFocus"
ShellAndWait txtProgram.Text, vbMinimizedNoFocus
Case "vbNormalFocus"
ShellAndWait txtProgram.Text, vbNormalFocus
Case "vbNormalNoFocus"
ShellAndWait txtProgram.Text, vbNormalNoFocus
End Select
End Sub
Private Sub Form_Load()
cboShellStyle.ListIndex = 4
End Sub |
|
| |
Category : About Me
| By : admin | Comments [0] | Trackbacks [0] |
|
|
| 03 Sep 2006 04:19:01 pm |
Hapus brontok manual |
|
|
Beberapa program anti-virus diantaranya sudah bisa mengatasi worm ini. Tapi … entahlah, dari pengalaman saya pribadi, beberapa kali coba install Norton AntiVirus 2005, selalu gagal. Yah, mungkin karena CD yang dipakainya bajakan . Jadi, akhirnya saya pribadi lebih suka menghapus BRONTOK dengan cara manual.
Ada beberapa indikasi sederhana komputer terinfeksi BRONTOK.
1. Pilihan Tools - Folder Option pada Windows Explorer tidak muncul.
2. Muncul file executable yang icon dan namanya sama persis dengan icon dan nama folder.
3. REGEDIT.EXE tidak bisa dijalankan.
4. Restart Windows pada saat membuka Control Panel
BRONTOK diaktifkan melalui registri windows yang akan dijalankan saat start-up windows. Letaknya di:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Bron-Spizaetus
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Tok-Cirrhatus
Untuk menghentikan BRONTOK, kita hanya perlu menghapus value registry tersebut. Tapi, masalahnya, untuk REGEDIT-nya itu sendiri sebelumnya sudah di blok oleh BRONTOK lewat registry di:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegedit.
Juga ada file Empty.pid yang biasanya terletak diroot direktory (umumnya di C:\) Untuk yang ini, penghapusan bisa langsung dilakukan via Windows Explorer.
Selain dari itu, BRONTOK juga diaktifkan lewat Scheduled Tasks (di Control Panel). Tapi, untuk menghapus ini pun, tidak bisa langsung, masalahnya, pada saat kita membuka Control Panel, BRONTOK akan langsung melakukan restart windows. Jadi, penghapusan Scheduled Tasks harus dilakukan di Windows Safe Mode.
Jadi, cobalah cari program lain selain REGEDIT yang bisa digunakan untuk edit registry. Saya pribadi lebih suka menggunakan program HiJack.
Apapun program edit registry yang Anda pakai, gunakan pada windows safe mode. Sesudah ketiga registry tersebut dihapus, restart, kembali ke WINDOWS. Sampai tahap ini, BRONTOK sudah tidak lagi berjalan pada sistem Anda. Tapi, meskipun demikian, BRONTOK meninggalkan file-file tipuan yang banyak pada sistem. Untuk ini, hapus file dilakukan secara manual. Tapi untuk mempermudah, gunakan fasilitas Search pada Windows. Cari file (Search for: *.exe) dengan ukuran kurang dari 41KB (Size: At most 41 KB). Pada daftar, akan cukup banyak file executable (*.exe) yang ditemukan. Cari saja executable yang iconnya sama dengan icon folder. Untuk lebih mempermudah lagi, urutkan hasil pencarian berdasarkan ukurannya. Nah … dapet deh.
Jadi, secara garis besar, prosesnya adalah sebagai berikut:
1. Siapkan program editor registry
2. Restart komputer, masuk SAFE MODE.
3. Hapus item BRONTOK di registry
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Bron-Spizaetus
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Tok-Cirrhatus
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegedit.
4. Hapus Empty.pif (biasanya di C:\)
5. Hapus item BRONTOK di Task Scheduler
6. Restart komputer, masuk Windows normal.
7. Hapus file-file tipuan yang masih tersisa.
Cara ini tentunya bukan cara yang praktis, tapi … yah setidaknya bisa keliatan sedikit lebih keren , bisa hapus BRONTOK secara manual. Lagi pula secara umum, dari beberapa kasus worm yang saya temui, proses hapus worm dari sistem windows kurang lebih sama. Jadi, kalau Anda bisa terbiasa dengan cara ini, kalau suatu saat Anda menemui worm lain, Anda bisa coba untuk menghapusnya secara manual, tidak perlu repot-repot cari update anti virus baru. |
|
| |
Category : windows
| By : admin | Comments [5] | Trackbacks [0] |
|
|
| 20 Aug 2006 02:19:44 pm |
3 tier program |
|
|
Listing 1 - VB5
Function GetList() As ADODB.Recordset
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Dim objContext As ObjectContext
Set objContext = GetObjectContext()
On Error GoTo GetListError
' Open the connection
cn.Open mszDSN' Get the list of vendors
rs.CursorLocation = adUseClientBatch
rs.Open mszSQLGETVENDORS, cn, adOpenUnspecified, _
adLockUnspecified, adCmdUnspecified
' Setup the recordset to return
Set GetList = rs
' Disconnect the recordset
Set rs.ActiveConnection = Nothing
' Close the connection
cn.Close
objContext.SetComplete
Exit Function
GetListError:
' Raise a generic error and pass the description on
objContext.SetAbort
Err.Raise vbObjectError + 100, mszCLASSNAME, _
Err.Description
End Function
Listing 2 - VB5
Sub LoadVendorList()
Dim rs As ADOR.Recordset
Dim clsVend As New CVendor
' Clear the listbox
lstVendors.Clear
' Get all the vendors and
Set rs = clsVend.GetList
' Loop through and add vendors
Do While Not rs.EOF
' Add the vendor name
lstVendors.AddItem rs("Name")
' Store the VendorID
lstVendors.ItemData(lstVendors.NewIndex) = _
rs("VendorID")
' Get the next vendor
rs.MoveNext
Loop
End Sub
Listing 3 - VB5
Private Sub CFindInterface_FindByID(lID As Long)
Dim iCount As Integer
' Refresh the list
LoadProductList
' Loop through and look for specified vendor
For iCount = 0 To lstProducts.ListCount - 1
' Did we find it?
If lstProducts.ItemData(iCount) = lID Then
' Select that one
lstProducts.ListIndex = iCount
' Bail out
Exit For
End If
Next
End Sub
Listing 4 - VB5
Private Sub lstRelatedProduct_DblClick()
Dim clsFind As New CFindInterface
' Get a find interface
Set clsFind = Parent.Frame.GetPanel( _
"Products").Control.object
' Find the vendor
clsFind.FindByID lstRelatedProduct.ItemData( _
lstRelatedProduct.ListIndex)
' Show the control
Parent.Frame.SetActivePanel "Products"
End Sub
Listing 5 vb5
If bNew Then
iVendorID = clsVend.Add(txtName, txtAddress1, _
txtAddress2, txtCountry, txtCity, _
txtState, txtZip, txtPostalCode, mskPhone, _
txtFax, txtEmail, txtURL, mskTollFree, _
txtContactName, mskContactPhone, txtContactEmail)
bNew = False
Else
iVendorID = lstVendors.ItemData( _
lstVendors.ListIndex)
clsVend.Update iVendorID, txtName, _
txtAddress1, txtAddress2, txtCountry, _
txtCity, txtState, txtZip, txtPostalCode, _
mskPhone, txtFax, txtEmail, txtURL, _
mskTollFree, txtContactName, _
mskContactPhone, txtContactEmail
End If
Listing 6 - VB5
Private Sub CToolbarInterface_DeleteItem()
Dim clsProd As New CProduct
' Check if there is already a new record pending
If bNew Then
' Ask if they want to save
If MsgBox( _
"Do you want to save the new vendor?", _
vbYesNo) = vbYes Then
' Attempt a save
If Not SaveItem Then
' If it fails, bail so user can correct mistake
Exit Sub
End If
End If
bNew = False
End If
' Delete the item
clsProd.Delete lstProducts.ItemData( _
lstProducts.ListIndex)
' clear the controls
ClearControls
' Reload the list of products
LoadProductList
End Sub
Private Sub CToolbarInterface_NewItem()
' Check if there is already a new record pending
If bNew Then
' Ask if they want to save
If MsgBox("Do you want to save the new vendor?", _
vbYesNo) = vbYes Then
' Attempt a save
If Not SaveItem Then
' If it fails, bail so user can correct mistake
Exit Sub
End If
End If
End If
' Clear the controls
ClearControls
' Deselect the current vendor
lstProducts.ListIndex = -1
' Set the new flag
bNew = True
End Sub
Private Sub CToolbarInterface_RefreshItem()
Dim lProductID As Long
Dim iCount As Integer
' If a product is selected store it's productid
If lstProducts.ListIndex >= 0 Then
' Store the ID
lProductID = lstProducts.ItemData( _
lstProducts.ListIndex)
Else
' Else store indicator that no product
' was selected
lProductID = -1
End If
' Reload the product list
LoadProductList lProductID
End Sub
Private Sub CToolbarInterface_SaveItem()
' Call the save routine
SaveItem
End Sub
Private Sub lstDownloads_DblClick()
Dim clsFind As New CFindInterface
' Get a find interface
Set clsFind = Parent.Frame.GetPanel( _
"Downloads").Control.object
' Find the vendor
clsFind.FindByID lstDownloads.ItemData( _
lstDownloads.ListIndex)
' Show the control
Parent.Frame.SetActivePanel "Downloads"
End Sub
Listing 7 - VB5
Private Sub btnDelete_Click(Index As Integer)
Dim tbtemp As CToolbarInterface
Set tbtemp = Frame.GetActivePanel.Control.object
tbtemp.DeleteItem
Set tbtemp = Nothing
End Sub
Private Sub btnNew_Click()
Dim tbtemp As CToolbarInterface
Set tbtemp = Frame.GetActivePanel.Control.object
tbtemp.NewItem
Set tbtemp = Nothing
End Sub
Private Sub btnRefresh_Click(Index As Integer)
Dim tbtemp As CToolbarInterface
Set tbtemp = Frame.GetActivePanel.Control.object
tbtemp.RefreshItem
Set tbtemp = Nothing
End Sub
Private Sub btnSave_Click()
Dim tbtemp As CToolbarInterface
Set tbtemp = Frame.GetActivePanel.Control.object
tbtemp.SaveItem
Set tbtemp = Nothing
End Sub |
|
| |
Category : visual basic
| By : admin | Comments [0] | Trackbacks [0] |
|
| |
| 1 2 3 4 Next |
|
|