Hosting Gratis

Pages

Sunday, December 30, 2012

Listview pada VB6

Haii brother smua....
Kali ini ane mau share tentang code vb6 khususnya listview. Bagaimana menambahkan itemas baru ke dalam list view. Berikut code nya....

listview1.ListItems.Add ,,"items1"
listview1.ListItems.Add ,,"items2"
listview1.ListItems.Add ,,"items3"
listview1.ListItems.Add ,,"items4"
dst.....

Untuk menambahkan chechbox kedalam listview, berikut code:


ListView1.Checkboxes = True

Untuk menambahkan checkbox dan item (menjadikan listview menjadi 2 kolom), berikut code:

ListView1.Checkboxes = True
listview1.ListItems.Add ,,"items1"
listview1.ListItems.Add ,,"items2"
listview1.ListItems.Add ,,"items3"
listview1.ListItems.Add ,,"items4"
dst.....


Untuk Operasi ListView lainya, silahkan ditunggu yach....

Ane tunggu komennya....

Monday, December 24, 2012

Installing Eclipse


Read this document in its entirety before installing Eclipse.
This semester we will use the Eclipse software for writing, compiling, and testing programming assignments. Although you can use Eclipse at school (see Launching Eclipse on Solaris) we highly recommend you install the Eclipse environment on your computer. Accessing Eclipse remotely through the campus network is theoretically possible, but extremely slow.
The Eclipse installation process has four main steps:
  1. Install the Java 5.0 software.
  2. Install the Eclipse 3.1 software (It does not includes Java 5.0).
  3. Launch Eclipse.
  4. Install a set of plugins designed especifically for courses taught in the Dept of Computer Science.
The files you will need to download are quite large so it is necessary you have a fast internet connection. For people that have slow connections (e.g., telephone modem), we can provide a limited number of CD's with the required software or you could copy the files to a CD from one of the wam labs on campus.   Please contact your instructor or teaching assistant for more details.
Next we describe the installation process for Windows and for Mac OS X.  If you have a system different from Windows or Mac OS X (e.g., linux) see the "Software Source" section below.  Feel free to skip the section that does not apply to your system.
Installation Process for Windows
  1. Install Java 5.0
    1. Download the file jdk-1_5_0_04-windows-i586-p.exe.
    2. Double-click on the previously downloaded file and following the installation instructions.
  2. Install Eclipse 3.1 software (It does not includes Java 5.0)
    1. Download the file eclipse-SDK-3.1-win32.zip.
    2. Once you have unzipped the previously downloaded file, you will see a folder named eclipse.  In that folder you will find the eclipse application (a big blue dot).  We recommend you create a shortcut on the desktop to simplify the launching of eclipse.  Notice that unlike Java, Eclipse does not have an installation process.  Once you have unzipped the file you are done.
  3. Launch Eclipse
    1. Follow the steps in launching Eclipse.
  4. Installing the plugins
    1. Launch eclipse if you have done so.
    2. Follow the instructions provided on the web site http://www.cs.umd.edu/~pugh/eclipse.  After installing the new plugins, you will need to relaunch Eclipse.  Keep in mind that you will not be able to submit projects if you don't complete the installation of these plugins.

Installation Process for Mac OS X
  1. Install Java 5.0
    1. If you have a Mac and are planning to use Java 5.0 you must update your OS to Tiger.  As a student of the University you can obtain a copy of this software for $20.00.  Visit the web site Mac OS X v.10.4 for further information.
    2. Follow the instructions on the web page (J2SE) 5.0 Release 1 for Tiger
  2. Install Eclipse 3.1 software (It does not includes Java 5.0)
    1. Download the file eclipse-SDK-3.1-macosx-carbon.tar
    2. After double-clicking on the previously downloaded file, you will see a folder named eclipse.  In that folder you will find the eclipse application (a big blue dot).  We recommend you create a shortcut on the desktop to simplify the launching of eclipse.  Notice that unlike Java, Eclipse does not have an installation process.  Once you have untarred the file you are done.
  3. Launch Eclipse
    1. Follow the steps in launching Eclipse.
  4. Installing the plugins
    1. Launch eclipse if you have done so.
    2. Follow the instructions provided on the web site http://www.cs.umd.edu/~pugh/eclipse.  After installing the new plugins, you will need to relaunch Eclipse.  Keep in mind that you will not be able to submit projects if you don't complete the installation of these plugins.

Software Source
At some point you may want to take a look at the Eclipse and Java web sites.  In particular, those using a platform different from Windows or Mac OS X will need to access the necessary software from:


source 

Friday, December 21, 2012

Membaca dan Menulis File Teks dengan VB.NET


Untuk membaca dan menulis file teks (*.txt) dengan VB.NET dapat menggunakan beberapa cara, salah satunya adalah dengan menggunakan kelas StreamReader dan  kelas StreamWriter yang terdapat pada System.IO package.
Berikut ini adalah contoh function untuk membaca seluruh isi file teks dengan menggunakan method ReadToEnd pada class StreamReader:


01Public Function BacaSeluruhFile(ByVal FullPath As String)
02 Dim fileReader As StreamReader
03 Dim content As String = ""
04 Try
05   fileReader = New StreamReader(FullPath)
06   content = fileReader.ReadToEnd()
07   fileReader.Close()
08 Catch x As Exception
09   MsgBox(x.Message)
10 End Try
11 Return content
12End Function
Sedangkan yang berikut ini adalah contoh function untuk membaca isi file teks pada baris tertentu dengan menggunakan method ReadLine pada class StreamReader:


01Public Function BacaBarisKe(ByVal FullPath As String, _
02ByVal baris As Integer)
03 Dim fileReader As StreamReader
04 Dim content As String = ""
05 Dim i As Integer
06 Try
07   fileReader = New StreamReader(FullPath)
08   For i = 1 To baris
09     content = fileReader.ReadLine()
10   Next
11   fileReader.Close()
12 Catch x As Exception
13   MsgBox(x.Message)
14 End Try
15 Return content
16End Function
Adapun untuk menulis String ke dalam sebuah file teks dapat mengunakan method Write pada class StreamWriter seperti pada procedure dalam contoh berikut ini:


01Public Sub WriteContent(ByVal FullPath As String, _
02ByVal content As String)
03 Dim fileWriter As StreamWriter
04 Try
05   fileWriter = New StreamWriter(FullPath)
06   fileWriter.Write(content)
07   fileWriter.Close()
08 Catch x As Exception
09   MsgBox(x.Message)
10 End Try
11End Sub
Yang penting, jangan lupa mengimport System.IO package dengan menuliskan:


1Imports System.IO
pada bagian global declaration. Semoga bermanfaat

Thursday, December 20, 2012

Cara Paling Mudah Men-share Internet Pake Mikrotik


Langkah2 nya mudah, tak perlu pusing dengan text mode yang ada di mikrotik, ada yang bisa pakai GUI...
1. Download terlebih dahulu winbox, kemudian sambungkan switch ke port yang akan di digunakan sebagai port LAN atau bisa juga langsung dari komputer ke port LAN setelah diset baru dipindah ke switch
2. buka winbox klik di kotak yang ada tanda ... mikrotik anda akan segera terdeteksi jika tidak ada masalah, pilih mac-address mikrotik anda (jika blm ada ip-nya)
3. bagi yang pake RB biasanya ada default configuration pada RB anda, buang dulu default configuration, pilihan ini ada pada saat pertama kali anda terhubung dengan RB anda
4. masukkan ip pada lan port mikrotik
Code:

ip address add address=192.168.0.1/24 interface=lan

5. setting DHCP-SERVER, klik ajah dibagian IP>DHCP-SERVER, trus klik bagian DHCP SETUP, paling mantep neh buat yang ngga bisa lepas dari windows, karena tinggal ikutin ajah (next-next-next-default syndrome)
6. setting ip pada bagian port internet, tinggal sesuaikan dengan ISP anda (setting untuk PPPoE-Client berbeda jadi kalau pake PPPoE silahkan lihat bagian bawah lagi (akan ditambahkan belakangan))
7. Masukkan default gateway
Code:

ip route add gateway=(IP gateway ISP)

8. lakukan masquerading pada port yang akan dicolok ke modem,wireless, dll
Code:

ip firewall nat add chain=src-nat action=masquerade out-interface=internet

9. colok port internet ke perangkat yang terhubung ke internet bisa modem, AP client, dll
10. DONE, sekarang tinggal pake tuh internet jangan lupa colokin ke switch port lan-nya kl banyak user yang mau pake, kl cuman elo sendiri ngga usah beli mikrotik mending colok tuh modem, wireless, dll ke komputermu

Firewall Mikrotik (Arp Filtering)


Sebenarnya untuk Filter ip arp sangat mudah dimikrotik..
berikut caranya:
1. aktifkan arp-reply only
[admin@mikrotik] interface ethernet set LAN arp=reply-only
atau rubah lewat winbox di Interface.
arp
setelah itu arp akan aktif dan semua koneksi yang menuju LAN akan di deny / drop terkecuali kita add IP yang kita perbolehkan
2. add IP address dan MAC address yang diperbolehkan
[admin@mikrotik] ip arp add address=172.16.0.8 interface=LAN mac-address:00:00:00:00:00:00
atau via winbox di IP > ARP
Screenshot - 7_22_2009 , 5_41_27 PM

Screenshot - 7_22_2009 , 5_41_53 PM
Tips,, dengan cara lain sebelum mengganti settingan interface menjadi reply-only. Lihat dulu
ip arp... kemudian lihat semua ip. dan dicocokan dengan mac addressnya masing-masing.
Jika cocok semua.. Pilih salah satu ip arp, kemudian klik kanan, pilih make static.



Nb: Jika Anda setting seperti ini dari winbox atau remote comp maka Langkah awalnya yaitu nge Add komputer Anda dulu ke dalam Arp, baru mengaktifkan Arpreply only, Agar comp anda tidak terkena filter :P. Good Luck!