Share this topic on Del.icio.usShare this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on SlashdotShare this topic on StumbleUponShare this topic on TechnoratiShare this topic on TwitterShare this topic on YahooShare this topic on Google buzz

Author Topic: [Share] Code VB 6.0 (yang mungkin berguna)  (Read 756 times)

0 Members and 1 Guest are viewing this topic.

Offline Pocan

  • Newbie
  • *
  • Posts: 8
  • Reputasi: 1
  • AntiTrust = Trust No One

  • Aktivitas bulan ini
    0%
  • Lokasi: Makassar, Celebes Kidul
  • Jenis Kelamin: Laki-laki
[Share] Code VB 6.0 (yang mungkin berguna)
« on: 28 July 2010, 12:10:41 »
salam...

saya ada ide untuk share code yang mungkin berguna untuk rekan2 sekalian, siapa saja boleh share codenya

share pertama

Option Explicit
untuk memaksa program agar selalu mendeklarasikan variabel yang akan kita pake
Anda harus secara eksplisit menyatakan semua variabel dengan menggunakan Dim atau pernyataan ReDim. If you attempt to use an undeclared variable name, an error occurs at compile time. Jika Anda mencoba untuk menggunakan nama variabel tidak diumumkan, kesalahan terjadi pada waktu kompilasi.

Use Option Explicit to avoid incorrectly typing the name of an existing variable or to avoid confusion in code where the scope of the variable is not clear. Gunakan Opsi eksplisit untuk menghindari salah mengetik nama variabel yang ada atau untuk menghindari kebingungan dalam kode di mana ruang lingkup variabel tidak jelas. If you do not use the Option Explicit statement, all undeclared variables are of Object type. Jika Anda tidak menggunakan Option Explicit pernyataan, semua variabel dideklarasikan adalah tipe Obyek.
.:: Di Atas Langit Masih Ada Langit ::.

Forum Informatika

[Share] Code VB 6.0 (yang mungkin berguna)
« on: 28 July 2010, 12:10:41 »
Sponsored Links:


Offline 1nf0rm4t1c5

  • Administrator
  • *
  • Posts: 1090
  • Reputasi: 15
  • Informatics Developer

  • Aktivitas bulan ini
    4%
    • Forum Informatika
  • Lokasi: Indonesia
  • Jenis Kelamin: Laki-laki
Re: [Share] Code VB 6.0 (yang mungkin berguna)
« Reply #1 on: 28 July 2010, 16:05:19 »
Trims. Silakan terus berbagi pengetahuan Anda di sini. Mudah2an bermanfaat. ;)
Full access for guest [REGISTER]
Please read the rule [RULES]
Promosi?  [STEP-BY-STEP]

RAR PASSWORD : http://if.web.id --> buat buka file rar

Offline Pocan

  • Newbie
  • *
  • Posts: 8
  • Reputasi: 1
  • AntiTrust = Trust No One

  • Aktivitas bulan ini
    0%
  • Lokasi: Makassar, Celebes Kidul
  • Jenis Kelamin: Laki-laki
Re: [Share] Code VB 6.0 (yang mungkin berguna)
« Reply #2 on: 29 July 2010, 01:26:56 »
Mengetahui Serial Number Harddisk
Code: [Select]
Option Explicit
Private Declare Function GetVolumeInformation& Lib "kernel32" _
    Alias "GetVolumeInformationA" (ByVal lpRootPathName _
    As String, ByVal pVolumeNameBuffer As String, ByVal _
    nVolumeNameSize As Long, lpVolumeSerialNumber As Long, _
    lpMaximumComponentLength As Long, lpFileSystemFlags As _
    Long, ByVal lpFileSystemNameBuffer As String, ByVal _
    nFileSystemNameSize As Long)
    Const MAX_FILENAME_LEN = 256

Public Function SerNum(Drive$) As Long

    Dim No&, s As String * MAX_FILENAME_LEN
    Call GetVolumeInformation(Drive + ":\", s, MAX_FILENAME_LEN, _
    No, 0&, 0&, s, MAX_FILENAME_LEN)
    SerNum = No
End Function

Private Sub Form_Load()
  MsgBox "Serial Number Drive [C] : " & SerNum("C"), 64, "SN HDD " 'bebas mo ditaro dimana'   
End Sub
.:: Di Atas Langit Masih Ada Langit ::.