->>>>>BASE APPLY IS VISUAL BASIC 6.0<<<<<-


The is Visual Basic? Said“ Visual” make the
point which applied for making Graphical User
Interface ( GUI). In This Way You [shall] no longer
write down instruction pemrograman in lines codes,
but easyly You can do drag and drop objects which You
to apply.
Said“ Basic” is language part BASIC(Beginners
All Purpose Symbolic Instruction Code), that is a
programming language which in the history have many
applied by of programmers for compiling application.
Visual Basic is developed from BASIC programming
language.


1.1 Start Visual Basic 6.0
After You instal program Visual Basic 6.0,
You can start with button Start on the taskbar at
Windows. Following the stages;steps completely.
1. Depress button Start from Taskbar at Windows.
2. Choose All, Programs, and point at choice of
Microsoft Visual Studio 6.0 and click at choice
of Microsoft Visual Basic 6.0.

Gambar 1.1 Membuka Program Visual Basic 6.0
3. After You successfully implement Visual Basic for
the things first time his(its, You will see logo
display Visual Basic 6.0 and a few moment later
will emerge dialogue box following.

Gambar 1.2 Kotak Dialog New Project
4. The dialogue box ask confirmation to You is for
choosing project type wishing You making. In this case,
select;choose project type VB Enterprise Edition Constrols.
Depress button Open for continuing.

Gambar 1.3 Kotak Dialog Pemilihan Tipe Proyek
5. With election of type VB Enterprise Edition Controls above,
a user not necessarily again weary added the required
components. That thing is because at the project type
have provided components completely. Depress button Open
for continuing.
6. After buttoning Open, will emerge a program [screen/sail]
Visual Basic by accompanied by is complete components on
the part of General or Toolbox.

Gambar 1.4 Tampilan Interface Visual Basic
7. Display above can called as area of Integrated Development
Environment ( IDEA). At area of the, You can do various
activities like processes editing, compiling, and debugging.


1.2 Mengenal Elemen Visual Basic 6.0
After You successfully open Visual Basic at [screen/sail],
You will find interface program Visual Basic like Picture of 1.4.
Seen that interface consisting of some element.

1.2.1 Menu Bar
Menu Bar will present comands available for You apply
Your moment working for Visual Basic. In default, this bar menu
have choice of File, Edit, View, Window, Query, Diagram, Tools,
Add-Ins, and Help. The side, referring to pemrograman, there
are menu which can be accessed, for example Project, Format,
Debug, or Run.

Gambar 1.5 Tampilan Menu Bar
If each the bar menu clicked, Visual Basic will present
preference table from bar menu which You is click is the.

1.2.2 Context Menu
Context Menu contain shortcut which in a moment You
can apply for opening a context menu an object. For opening
this Context Menu, You can click right of object which You to
open the Context Menu. Following the picture display.


Gambar 1.6 Tampilan Context Menu
Context Menu above, we take away from Designer, Form, that
is by the way of clicking right of Form Designer.

1.2.3 Toolbar
This facility can quicken the comands access in
pemrograman. You can click buttons in this toolbar to do
certain action. standardly, toolbar type Standard which
will be presented by Your moment start Visual Basic.
If You wished to arrange display toolbar was other,
You can apply choice of Toolbar at bar menu View.

Gambar 1.7 Tampilan Toolbar

1.2.4 Toolbox
a window is containing of buttons control which
You would apply for designs or“ Membangun” a form or report.
Besides button control under, You also can define or
add x'self button control is other.

Gambar 1.8 Tampilan Toolbox Tipe Standard

Gambar 1.9 Tampilan Toolbox Tipe VB Enterprise Edition Controls
Come up not his(its of this window earn You arrange from
choice of Toolbox on the bar menu View - Toolbox.

1.2.5 Window Project Explorer
this Window Project Explorer present list form,
module, and also the other object in project active.
A Project is a group of file which You apply to develop
(build a application. Following the picture display.

Gambar 1.10 Tampilan Window Project Explorer

1.2.6 Window Properties
this Window Properties earn You apply to arrange
properties a or object control which You selecting.
a property is object characteristic, like size, caption,
text, or color.

Gambar 1.11 Tampilan Window Properties

1.2.7 Objek Browser
This browser object is enlisting the object in
project active. You can apply Object Browser for presenting
the object in Visual Basic and the application of other.
To present this object You can apply way of View-Object
Browser. Following the picture display.

Gambar 1.12 Tampilan Object Browser

1.2.8 Form Designer
Form Designer is a window available for You apply
to arrange display the application of which You compiling,
or equally as place of design a form. In this form You can
add control, graphic, and draw into form on course which
You wish. Every form have window designer form x'self.
Following the pictures displays

Gambar 1.13 Tampilan Form Designer

1.2.9 Window Code Editor
Window Code Editor is a display window which applied
to enter application code. this Window Code Editor applied
to define codes form or modules codes in a applications.
Following the picture display.

Gambar 1.14 Tampilan Window Code Editor

1.2.10 Window Form Layout
Window Form Layout applicable to control position of
form at the application of You apply graphic system in a
[screen/sail]. With this facility, You can see and know
position of form new You is design. Following the picture display.

Gambar 1.15 Tampilan Window Form Layout

1.2.11 Window Immmediate, Local, dan Watch
this Window-window is window addition which applied
for debug process the application of you. this Window-window
You can only applied if You implement application with
interface Visual Basic. To present this window-window,
You can do him(it by the way of View - Name Window.

Gambar 1.16 Tampilan Window Immediate

Gambar 1.17 Tampilan Window Locals

Gambar 1.18 Tampilan Window Watches

Sabtu, 03 Mei 2008

ACTIVE HOST


Source code under this is a[n program for
checked an Host Yang is active that is to know what
particular computer being is active.
1. OPen 1 Project(name=ActiveIP.vbp)
2. Add 1 Form(name=frmCekIP)tambahkan:
a. 1 ListBox
b. 2 TextBox
c. 1 CommandButton(name=CekIP)


Copy coding under this and paste in Editor Form:

Option Explicit
Const SOCKET_ERROR = 0
Private Declare Function GetHostByName Lib "wsock32.dll" _
Alias "gethostbyname" (ByVal HostName As String) As Long
Private Declare Function WSAStartup Lib "wsock32.dll" _
(ByVal wVersionRequired&, ipWSAdata As WSAdata) As Long
Private Declare Function WSACleanup Lib "wsock32.dll" () As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" _
(hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)
Private Declare Function IcmpCreateFile Lib "icmp.dll" () As Long
Private Declare Function IcmpCloseHandle Lib "icmp.dll" _
(ByVal HANDLE As Long) As Boolean
Private Declare Function IcmpSendEcho Lib "ICMP" (ByVal IcmpHandle As Long, _
ByVal DestAddress As Long, ByVal RequestData As String, _
ByVal RequestSize As Integer, RequestOptns As IP_OPTION_INFORMATION, _
ReplyBuffer As IP_ECHO_REPLY, ByVal ReplySize As Long, ByVal TimeOut As Long) As Boolean

Private Type WSAdata
wVersion As Integer
wHighVersion As Integer
szDescription(0 To 255) As Byte
szSystemStatus(0 To 128) As Byte
iMaxsockets As Integer
iMaxUdpDg As Integer
ipVendorInfo As Long
End Type

Private Type Hostent
h_name As Long
h_aliases As Long
h_addrtype As Integer
h_length As Integer
h_addr_list As Long
End Type

Private Type IP_OPTION_INFORMATION
TTL As Byte
Tos As Byte
Flags As Byte
OptionsSize As Long
OptionsData As String * 128
End Type

Private Type IP_ECHO_REPLY
Address(0 To 3) As Byte
Status As Long
RoundTripTime As Long
DataSize As Integer
Reserved As Integer
data As Long
Options As IP_OPTION_INFORMATION
End Type
Public dir As String


Public Function doPing(ByVal HostName As String) As Boolean
Dim hFile As Long, ipWSAdata As WSAdata
Dim hHostent As Hostent, Addrlist As Long
Dim Address As Long, rIP As String
Dim OptInfo As IP_OPTION_INFORMATION
Dim EchoReply As IP_ECHO_REPLY
Call WSAStartup(&H101, ipWSAdata)
If GetHostByName(HostName + String(64 - Len(HostName), 0)) <> SOCKET_ERROR Then
CopyMemory hHostent.h_name, ByVal GetHostByName(HostName + String(64 - Len(HostName), 0)), Len(hHostent)
CopyMemory Addrlist, ByVal hHostent.h_addr_list, 4
CopyMemory Address, ByVal Addrlist, 4
End If
hFile = IcmpCreateFile()
If hFile = 0 Then
MsgBox "Unable to create File Handle", vbCritical + vbOKOnly
doPing = False
Exit Function
End If
OptInfo.TTL = 225
If IcmpSendEcho(hFile, Address, String(32, "A"), 32, OptInfo, EchoReply, Len(EchoReply) + 8, 2000) Then
rIP = CStr(EchoReply.Address(0)) + "." + CStr(EchoReply.Address(1)) + "." + _
CStr(EchoReply.Address(2)) + "." + CStr(EchoReply.Address(3))
Else
doPing = False
End If
If EchoReply.Status = 0 Then
doPing = True
Else
doPing = False
End If
Call IcmpCloseHandle(hFile)
Call WSACleanup
End Function

Private Sub Command1_click()
Dim i As Integer
Dim x, y
Dim result As Boolean
Dim resultString As String
If Trim(Text1) = "" Then
MsgBox "Isikan alamat IP", vbCritical + vbOKOnly
Exit Sub
End If
List1.Clear
x = Split(Text1.Text, ".")
y = Split(Text2.Text, ".")
For i = CInt(x(3)) To CInt(y(3))
dir = x(0) & "." & x(1) & "." & x(2) & "." & i
result = doPing(dir)
If result = True Then
resultString = "Aktif"
Else
resultString = "Non-aktif"
End If
List1.AddItem "Pinging" & dir & "..." & resultString
List1.Refresh
Next
End Sub

Tidak ada komentar: