f



Get the Serial Number with Visual Basic

Hi folks,

I have to write a Visual Basic 6.0 Program and need to uniquely identify a
computer in a network and the user mustn't be able to change that id while my
program is running. So the Volume Serial Number of the HDD isn't a possibility,
because you can set the Volume SN whatever you want and therefore it's not
unique in a Network. I heard that there's a manufacturer's Serial Number on the
HDD that can't be changed and that is unique (worldwide?). How can I get that SN
with VB6? Or do you have any other ideas? Like a BIOS SN?

Thanks a lot in advance,

Michael
PS: Answer in German is ok.

0
e0026159 (2)
11/13/2003 12:38:13 PM
comp.lang.basic.visual.misc 10153 articles. 0 followers. Post Follow

16 Replies
1202 Views

Similar Articles

[PageSpeed] 51

On Thu, 13 Nov 2003 13:38:13 +0100, "Michael Wittmann"
<e0026159@stud3.tuwien.ac.at> wrote:

>Hi folks,
>
>I have to write a Visual Basic 6.0 Program and need to uniquely identify a
>computer in a network and the user mustn't be able to change that id while my
>program is running. So the Volume Serial Number of the HDD isn't a possibility,
>because you can set the Volume SN whatever you want and therefore it's not
>unique in a Network. I heard that there's a manufacturer's Serial Number on the
>HDD that can't be changed and that is unique (worldwide?). How can I get that SN
>with VB6? Or do you have any other ideas? Like a BIOS SN?

I've tried the Disk Serial number stuff, I think it is called SMART
- it does not work on one of my older disks

You could get the MAC address from the network card
- the API seems to be GetAdaptersInfo
- but it requires Win98+ or W2k+

(info in the downloadable API Guide from www.AllAPI.net )

Personally I am not so sure about this 'unique' hardware stuff

To me the only thing that is 'unique' is something that I issue, and I
*never* issue more than one of them

You only seem to be worried about keeping it 'unique' while your App
is running - this makes things simpler
- the 'unique' ID is unique to the session

Cannot you request a unique ID from a server when your App starts
- the server dishes up a 'number' which it will never dish up again

For security, I would also use an additional sequence number

Yet again, I would be inclined to go for a longer term 'unique naming'
approach
- the 'client' requests a unique ID - the server gives one
- that remains with the Client for life
- along with a Client and Server sequence number

Should the Client be cloned, then the sequence numbers are guaranteed
to fail 
- which is a pretty good indicator that something fishy is going on
- also - just one of the clients will be able to continue

IMO tying a stream of transactions is safer if it is tied to data
- hardware can change
- but your server will never issue the same code twice

However here is the code I snipped some time ago for SMART
- credits unknown
- also ignore the stuff about the FSO

A small snippet in a Form
and a monster in a .BAS module

======== STUFF IN FORM ==========

Option Explicit

Private Sub Command1_Click()
 Dim drv_info As DRIVE_INFO

   drv_info = GetDriveInfo(0)
   With drv_info
       If .bDriveType = 0 Then Label1.Caption = "[Not present]"
       If .bDriveType = 2 Then Label1.Caption = "[ATAPI drive - info
not available]"
       If .bDriveType = 1 Then
          Label1.Caption = Trim(.SerialNumber)
       End If
   End With

End Sub


====== STUFF IN .BAS MODULE =======

' 20th July 2002 from NG
' Works for Drive 0 - not 1

'Hi,
'
'Most hard disks sold in the last few years support SMART
(Self-Monitoring,
'Analysis, and Reporting Technology) using Microsoft scripting you can
use
'this to return the hard disk physical serial number, NOT the volume
serial
'number. This will not change with a reformat, re-install of OS etc,
etc. It
'will ONLY change if you replace the hard disk.
'
'To do this, use add a reference for Microsoft Scripting Runtime.
'
'Add the following to a .bas module (this was assembled from MSDN
online
'somewhere...)

'********************START OF BAS MODULE********************

Option Explicit

Private Type OSVERSIONINFO
    dwOSVersionInfoSize As Long
    dwMajorVersion As Long
    dwMinorVersion As Long
    dwBuildNumber As Long
    dwPlatformId As Long
    szCSDVersion As String * 128
End Type
Private Declare Function GetVersionEx Lib "kernel32" Alias
"GetVersionExA" (LpVersionInformation As OSVERSIONINFO) As Long

Private Type ATTR_DATA
    AttrID As Byte
    AttrName As String
    AttrValue As Byte
    ThresholdValue As Byte
    WorstValue As Byte
    StatusFlags As STATUS_FLAGS
End Type

Public Type DRIVE_INFO
    bDriveType As Byte
    SerialNumber As String
    Model As String
    FirmWare As String
    Cilinders As Long
    Heads As Long
    SecPerTrack As Long
    BytesPerSector As Long
    BytesperTrack As Long
    NumAttributes As Byte
    Attributes() As ATTR_DATA
End Type

Public Enum IDE_DRIVE_NUMBER
    PRIMARY_MASTER
    PRIMARY_SLAVE
    SECONDARY_MASTER
    SECONDARY_SLAVE
End Enum

Private Declare Function CreateFile _
        Lib "kernel32" Alias "CreateFileA" _
        (ByVal lpFileName As String, ByVal dwDesiredAccess As Long,
ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Long, _
        ByVal dwCreationDisposition As Long, _
        ByVal dwFlagsAndAttributes As Long, _
        ByVal hTemplateFile As Long) As Long
Private Declare Function CloseHandle _
        Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function DeviceIoControl _
        Lib "kernel32" (ByVal hDevice As Long, _
        ByVal dwIoControlCode As Long, _
        lpInBuffer As Any, _
        ByVal nInBufferSize As Long, _
        lpOutBuffer As Any, _
        ByVal nOutBufferSize As Long, _
        lpBytesReturned As Long, _
        ByVal lpOverlapped As Long) As Long
Public Declare Sub CopyMemory _
       Lib "kernel32" _
       Alias "RtlMoveMemory" (Destination As Any, _
       Source As Any, ByVal Length As Long)

Private Const GENERIC_READ = &H80000000
Private Const GENERIC_WRITE = &H40000000

Private Const FILE_SHARE_READ = &H1
Private Const FILE_SHARE_WRITE = &H2
Private Const OPEN_EXISTING = 3
Private Const FILE_ATTRIBUTE_SYSTEM = &H4
Private Const CREATE_NEW = 1

Private Const INVALID_HANDLE_VALUE = -1
Dim di As DRIVE_INFO

Public Const MAX_IDE_DRIVES = 4
' // Max number of drives assuming primary/secondary, master/slave
topology
Public Const READ_ATTRIBUTE_BUFFER_SIZE = 512
Public Const IDENTIFY_BUFFER_SIZE = 512
Public Const READ_THRESHOLD_BUFFER_SIZE = 512
Public Const OUTPUT_DATA_SIZE = IDENTIFY_BUFFER_SIZE + 16

'IOCTL commands
Public Const DFP_GET_VERSION = &H74080
Public Const DFP_SEND_DRIVE_COMMAND = &H7C084
Public Const DFP_RECEIVE_DRIVE_DATA = &H7C088

'---------------------------------------------------------------------
' GETVERSIONOUTPARAMS contains the data returned from the
' Get Driver Version function.
'---------------------------------------------------------------------
Public Type GETVERSIONOUTPARAMS
       bVersion       As Byte ' Binary driver version.
       bRevision      As Byte ' Binary driver revision.
       bReserved      As Byte ' Not used.
       bIDEDeviceMap  As Byte ' Bit map of IDE devices.
       fCapabilities  As Long ' Bit mask of driver capabilities.
       dwReserved(3)  As Long ' For future use.
End Type

'Bits returned in the fCapabilities member of GETVERSIONOUTPARAMS
Public Const CAP_IDE_ID_FUNCTION = 1             ' ATA ID command
supported
Public Const CAP_IDE_ATAPI_ID = 2                ' ATAPI ID command
supported
Public Const CAP_IDE_EXECUTE_SMART_FUNCTION = 4  ' SMART commannds
supported

'---------------------------------------------------------------------
' IDE registers
'---------------------------------------------------------------------
Public Type IDEREGS
   bFeaturesReg     As Byte ' // Used for specifying SMART "commands".
   bSectorCountReg  As Byte ' // IDE sector count register
   bSectorNumberReg As Byte ' // IDE sector number register
   bCylLowReg       As Byte ' // IDE low order cylinder value
   bCylHighReg      As Byte ' // IDE high order cylinder value
   bDriveHeadReg    As Byte ' // IDE drive/head register
   bCommandReg      As Byte ' // Actual IDE command.
   bReserved        As Byte ' // reserved for future use.  Must be
zero.
End Type

'---------------------------------------------------------------------
' SENDCMDINPARAMS contains the input parameters for the
' Send Command to Drive function.
'---------------------------------------------------------------------
Public Type SENDCMDINPARAMS
   cBufferSize     As Long     ' Buffer size in bytes
   irDriveRegs     As IDEREGS  ' Structure with drive register values.
   bDriveNumber    As Byte     ' Physical drive number to send command
to(0,1,2,3).
   bReserved(2)    As Byte     ' Bytes reserved
   dwReserved(3)   As Long     ' DWORDS reserved
   bBuffer()      As Byte      ' Input buffer.
End Type

' Valid values for the bCommandReg member of IDEREGS.
Public Const IDE_ATAPI_ID = &HA1               ' Returns ID sector for
ATAPI.
Public Const IDE_ID_FUNCTION = &HEC            ' Returns ID sector for
ATA.
Public Const IDE_EXECUTE_SMART_FUNCTION = &HB0 ' Performs SMART cmd.
                                               ' Requires valid
bFeaturesReg,
                                               ' bCylLowReg, and
bCylHighReg

' Cylinder register values required when issuing SMART command
Public Const SMART_CYL_LOW = &H4F
Public Const SMART_CYL_HI = &HC2

'---------------------------------------------------------------------
' Status returned from driver
'---------------------------------------------------------------------
Public Type DRIVERSTATUS
   bDriverError  As Byte          ' Error code from driver, or 0 if no
error.
   bIDEStatus    As Byte          ' Contents of IDE Error register.
                                  ' Only valid when bDriverError is
SMART_IDE_ERROR.
   bReserved(1)  As Byte
   dwReserved(1) As Long
 End Type

' bDriverError values
Public Enum DRIVER_ERRORS
       SMART_NO_ERROR = 0         ' No error
       SMART_IDE_ERROR = 1        ' Error from IDE controller
       SMART_INVALID_FLAG = 2     ' Invalid command flag
       SMART_INVALID_COMMAND = 3  ' Invalid command byte
       SMART_INVALID_BUFFER = 4   ' Bad buffer (null, invalid addr..)
       SMART_INVALID_DRIVE = 5    ' Drive number not valid
       SMART_INVALID_IOCTL = 6    ' Invalid IOCTL
       SMART_ERROR_NO_MEM = 7     ' Could not lock user's buffer
       SMART_INVALID_REGISTER = 8 ' Some IDE Register not valid
       SMART_NOT_SUPPORTED = 9    ' Invalid cmd flag set
       SMART_NO_IDE_DEVICE = 10   ' Cmd issued to device not present
                                  ' although drive number is valid
       ' 11-255 reserved
End Enum
'---------------------------------------------------------------------
' The following struct defines the interesting part of the IDENTIFY
' buffer:
'---------------------------------------------------------------------
Public Type IDSECTOR
   wGenConfig                 As Integer
   wNumCyls                   As Integer
   wReserved                  As Integer
   wNumHeads                  As Integer
   wBytesPerTrack             As Integer
   wBytesPerSector            As Integer
   wSectorsPerTrack           As Integer
   wVendorUnique(2)           As Integer
   sSerialNumber(19)          As Byte
   wBufferType                As Integer
   wBufferSize                As Integer
   wECCSize                   As Integer
   sFirmwareRev(7)            As Byte
   sModelNumber(39)           As Byte
   wMoreVendorUnique          As Integer
   wDoubleWordIO              As Integer
   wCapabilities              As Integer
   wReserved1                 As Integer
   wPIOTiming                 As Integer
   wDMATiming                 As Integer
   wBS                        As Integer
   wNumCurrentCyls            As Integer
   wNumCurrentHeads           As Integer
   wNumCurrentSectorsPerTrack As Integer
   ulCurrentSectorCapacity    As Long
   wMultSectorStuff           As Integer
   ulTotalAddressableSectors  As Long
   wSingleWordDMA             As Integer
   wMultiWordDMA              As Integer
   bReserved(127)             As Byte
End Type

'---------------------------------------------------------------------
' Structure returned by SMART IOCTL for several commands
'---------------------------------------------------------------------
Public Type SENDCMDOUTPARAMS
  cBufferSize   As Long         ' Size of bBuffer in
bytes(IDENTIFY_BUFFER_SIZE in our case)
  DRIVERSTATUS  As DRIVERSTATUS ' Driver status structure.
  bBuffer()    As Byte          ' Buffer of arbitrary length in which
to store the data read from the drive.
End Type

'---------------------------------------------------------------------
' Feature register defines for SMART "sub commands"
'---------------------------------------------------------------------

Public Const SMART_READ_ATTRIBUTE_VALUES = &HD0
Public Const SMART_READ_ATTRIBUTE_THRESHOLDS = &HD1
Public Const SMART_ENABLE_DISABLE_ATTRIBUTE_AUTOSAVE = &HD2
Public Const SMART_SAVE_ATTRIBUTE_VALUES = &HD3
Public Const SMART_EXECUTE_OFFLINE_IMMEDIATE = &HD4
' Vendor specific commands:
Public Const SMART_ENABLE_SMART_OPERATIONS = &HD8
Public Const SMART_DISABLE_SMART_OPERATIONS = &HD9
Public Const SMART_RETURN_SMART_STATUS = &HDA

'---------------------------------------------------------------------
' The following structure defines the structure of a Drive Attribute
'---------------------------------------------------------------------

Public Const NUM_ATTRIBUTE_STRUCTS = 30

Public Type DRIVEATTRIBUTE
       bAttrID As Byte         ' Identifies which attribute
       wStatusFlags As Integer 'Integer ' see bit definitions below
       bAttrValue As Byte      ' Current normalized value
       bWorstValue As Byte     ' How bad has it ever been?
       bRawValue(5) As Byte    ' Un-normalized value
       bReserved As Byte       ' ...
End Type
'---------------------------------------------------------------------
' Status Flags Values
'---------------------------------------------------------------------
Public Enum STATUS_FLAGS
       PRE_FAILURE_WARRANTY = &H1
       ON_LINE_COLLECTION = &H2
       PERFORMANCE_ATTRIBUTE = &H4
       ERROR_RATE_ATTRIBUTE = &H8
       EVENT_COUNT_ATTRIBUTE = &H10
       SELF_PRESERVING_ATTRIBUTE = &H20
End Enum

'---------------------------------------------------------------------
' The following structure defines the structure of a Warranty
Threshold
' Obsoleted in ATA4!
'--------------------------
------------------------------------------

Public Type ATTRTHRESHOLD
       bAttrID As Byte            ' Identifies which attribute
       bWarrantyThreshold As Byte ' Triggering value
       bReserved(9) As Byte       ' ...
End Type

'---------------------------------------------------------------------
' Valid Attribute IDs
'---------------------------------------------------------------------
Public Enum ATTRIBUTE_ID
       ATTR_INVALID = 0
       ATTR_READ_ERROR_RATE = 1
       ATTR_THROUGHPUT_PERF = 2
       ATTR_SPIN_UP_TIME = 3
       ATTR_START_STOP_COUNT = 4
       ATTR_REALLOC_SECTOR_COUNT = 5
       ATTR_READ_CHANNEL_MARGIN = 6
       ATTR_SEEK_ERROR_RATE = 7
       ATTR_SEEK_TIME_PERF = 8
       ATTR_POWER_ON_HRS_COUNT = 9
       ATTR_SPIN_RETRY_COUNT = 10
       ATTR_CALIBRATION_RETRY_COUNT = 11
       ATTR_POWER_CYCLE_COUNT = 12
       ATTR_SOFT_READ_ERROR_RATE = 13
       ATTR_G_SENSE_ERROR_RATE = 191
       ATTR_POWER_OFF_RETRACT_CYCLE = 192
       ATTR_LOAD_UNLOAD_CYCLE_COUNT = 193
       ATTR_TEMPERATURE = 194
       ATTR_REALLOCATION_EVENTS_COUNT = 196
       ATTR_CURRENT_PENDING_SECTOR_COUNT = 197
       ATTR_UNCORRECTABLE_SECTOR_COUNT = 198
       ATTR_ULTRADMA_CRC_ERROR_RATE = 199
       ATTR_WRITE_ERROR_RATE = 200
       ATTR_DISK_SHIFT = 220
       ATTR_G_SENSE_ERROR_RATEII = 221
       ATTR_LOADED_HOURS = 222
       ATTR_LOAD_UNLOAD_RETRY_COUNT = 223
       ATTR_LOAD_FRICTION = 224
       ATTR_LOAD_UNLOAD_CYCLE_COUNTII = 225
       ATTR_LOAD_IN_TIME = 226
       ATTR_TORQUE_AMPLIFICATION_COUNT = 227
       ATTR_POWER_OFF_RETRACT_COUNT = 228
       ATTR_GMR_HEAD_AMPLITUDE = 230
       ATTR_TEMPERATUREII = 231
       ATTR_READ_ERROR_RETRY_RATE = 250
End Enum

Dim colAttrNames As Collection
'***************************************************************************
' Open SMART to allow DeviceIoControl communications. Return SMART
handle
'***************************************************************************
Private Function OpenSmart(drv_num As IDE_DRIVE_NUMBER) As Long
   If IsWindowsNT Then
      OpenSmart = CreateFile("\\.\PhysicalDrive" _
                  & CStr(drv_num), _
                  GENERIC_READ Or GENERIC_WRITE, _
                  FILE_SHARE_READ Or FILE_SHARE_WRITE, _
                  ByVal 0&, OPEN_EXISTING, 0, 0)
   Else
      OpenSmart = CreateFile("\\.\SMARTVSD", _
                                0, 0, ByVal 0&, CREATE_NEW, 0, 0)
   End If
End Function

'***************************************************************************
' CheckSMARTEnable - Check if SMART enable
' FUNCTION: Send a SMART_ENABLE_SMART_OPERATIONS command to the drive
' bDriveNum = 0-3
'***************************************************************************

Private Function CheckSMARTEnable(ByVal hDrive As Long, _
            DriveNum As IDE_DRIVE_NUMBER) As Boolean
   'Set up data structures for Enable SMART Command.
   Dim SCIP As SENDCMDINPARAMS
   Dim SCOP As SENDCMDOUTPARAMS
   Dim lpcbBytesReturned As Long
   With SCIP
       .cBufferSize = 0
       With .irDriveRegs
            .bFeaturesReg = SMART_ENABLE_SMART_OPERATIONS
            .bSectorCountReg = 1
            .bSectorNumberReg = 1
            .bCylLowReg = SMART_CYL_LOW
            .bCylHighReg = SMART_CYL_HI
   'Compute the drive number.
            .bDriveHeadReg = &HA0 ' Or (DriveNum And 1) * 16
            .bCommandReg = IDE_EXECUTE_SMART_FUNCTION
        End With
        .bDriveNumber = DriveNum
   End With
   CheckSMARTEnable = DeviceIoControl(hDrive, _
                      DFP_SEND_DRIVE_COMMAND, SCIP, _
                      Len(SCIP) - 4, _
                      SCOP, Len(SCOP) - 4, lpcbBytesReturned, ByVal
0&)
End Function

'***************************************************************************

' DoIdentify
' Function: Send an IDENTIFY command to the drive
' DriveNum = 0-3
' IDCmd = IDE_ID_FUNCTION or IDE_ATAPI_ID
'***************************************************************************

Private Function IdentifyDrive(ByVal hDrive As Long, _
                               ByVal IDCmd As Byte, _
                               ByVal DriveNum As IDE_DRIVE_NUMBER) As
Boolean
    Dim SCIP As SENDCMDINPARAMS
    Dim IDSEC As IDSECTOR
    Dim bArrOut(OUTPUT_DATA_SIZE - 1) As Byte
    Dim sMsg As String
    Dim lpcbBytesReturned As Long
    Dim barrfound(100) As Long
    Dim i As Long
    Dim lng As Long
'   Set up data structures for IDENTIFY command.
    With SCIP
        .cBufferSize = IDENTIFY_BUFFER_SIZE
        .bDriveNumber = CByte(DriveNum)
        With .irDriveRegs
             .bFeaturesReg = 0
             .bSectorCountReg = 1
             .bSectorNumberReg = 1
             .bCylLowReg = 0
             .bCylHighReg = 0
' Compute the drive number.
             .bDriveHeadReg = &HA0
             If Not IsWindowsNT Then _
                .bDriveHeadReg = .bDriveHeadReg _
                Or (DriveNum And 1) * 16
' The command can either be IDE identify or ATAPI identify.
             .bCommandReg = CByte(IDCmd)
        End With
    End With
    If DeviceIoControl(hDrive, DFP_RECEIVE_DRIVE_DATA, _
                       SCIP, Len(SCIP) - 4, _
                       bArrOut(0), OUTPUT_DATA_SIZE, _
                       lpcbBytesReturned, ByVal 0&) Then
       IdentifyDrive = True
       CopyMemory IDSEC, bArrOut(16), Len(IDSEC)
       di.Model = SwapStringBytes(StrConv(IDSEC.sModelNumber,
vbUnicode))
       di.FirmWare = SwapStringBytes(StrConv(IDSEC.sFirmwareRev,
vbUnicode))
       di.SerialNumber = SwapStringBytes(StrConv(IDSEC.sSerialNumber,
vbUnicode))
       di.Cilinders = IDSEC.wNumCyls
       di.Heads = IDSEC.wNumHeads
       di.SecPerTrack = IDSEC.wSectorsPerTrack
    End If
End Function

'***************************************************************************
' ReadAttributesCmd
' FUNCTION: Send a SMART_READ_ATTRIBUTE_VALUES command to the drive
' bDriveNum = 0-3
'***************************************************************************

Private Function ReadAttributesCmd(ByVal hDrive As Long, _
                                   DriveNum As IDE_DRIVE_NUMBER) As
Boolean
   Dim cbBytesReturned As Long
   Dim SCIP As SENDCMDINPARAMS
   Dim drv_attr As DRIVEATTRIBUTE
   Dim bArrOut(OUTPUT_DATA_SIZE - 1) As Byte
   Dim sMsg As String
   Dim i As Long
   With SCIP
 ' Set up data structures for Read Attributes SMART Command.
       .cBufferSize = READ_ATTRIBUTE_BUFFER_SIZE
       .bDriveNumber = DriveNum
       With .irDriveRegs
            .bFeaturesReg = SMART_READ_ATTRIBUTE_VALUES
            .bSectorCountReg = 1
            .bSectorNumberReg = 1
            .bCylLowReg = SMART_CYL_LOW
            .bCylHighReg = SMART_CYL_HI
'  Compute the drive number.
            .bDriveHeadReg = &HA0
            If Not IsWindowsNT Then _
               .bDriveHeadReg = .bDriveHeadReg Or _
                                (DriveNum And 1) * 16
            .bCommandReg = IDE_EXECUTE_SMART_FUNCTION
       End With
  End With
  ReadAttributesCmd = DeviceIoControl(hDrive, DFP_RECEIVE_DRIVE_DATA,
_
                      SCIP, Len(SCIP) - 4, _
                      bArrOut(0), _
                      OUTPUT_DATA_SIZE, _
                      cbBytesReturned, ByVal 0&)
  On Error Resume Next
  For i = 0 To NUM_ATTRIBUTE_STRUCTS - 1
      If bArrOut(18 + i * 12) > 0 Then
         di.Attributes(di.NumAttributes).AttrID = bArrOut(18 + i * 12)
         di.Attributes(di.NumAttributes).AttrName _
                       = "Unknown value (" & bArrOut(18 + i * 12) &
")"
       '  di.Attributes(di.NumAttributes).AttrName = colAttrNames
(CStr(bArrOut(18 + i * 12)))
         di.NumAttributes = di.NumAttributes + 1
         ReDim Preserve di.Attributes(di.NumAttributes)
         CopyMemory di.Attributes(di.NumAttributes).StatusFlags, _
                     bArrOut(19 + i * 12), 2
         di.Attributes(di.NumAttributes).AttrValue = bArrOut(21 + i *
12)
         di.Attributes(di.NumAttributes).WorstValue = bArrOut(22 + i *
12)
      End If
  Next i
End Function

Private Function ReadThresholdsCmd(ByVal hDrive As Long, _
                         DriveNum As IDE_DRIVE_NUMBER) As Boolean
   Dim cbBytesReturned As Long
   Dim SCIP As SENDCMDINPARAMS
   Dim IDSEC As IDSECTOR
   Dim bArrOut(OUTPUT_DATA_SIZE - 1) As Byte
   Dim sMsg As String
   Dim thr_attr As ATTRTHRESHOLD
   Dim i As Long, j As Long
   With SCIP
 ' Set up data structures for Read Attributes SMART Command.
       .cBufferSize = READ_THRESHOLD_BUFFER_SIZE
       .bDriveNumber = DriveNum
       With .irDriveRegs
            .bFeaturesReg = SMART_READ_ATTRIBUTE_THRESHOLDS
            .bSectorCountReg = 1
            .bSectorNumberReg = 1
            .bCylLowReg = SMART_CYL_LOW
            .bCylHighReg = SMART_CYL_HI
'  Compute the drive number.
            .bDriveHeadReg = &HA0
            If Not IsWindowsNT Then _
              .bDriveHeadReg = .bDriveHeadReg Or _
                               (DriveNum And 1) * 16
            .bCommandReg = IDE_EXECUTE_SMART_FUNCTION
       End With
  End With
  ReadThresholdsCmd = DeviceIoControl(hDrive, _
                      DFP_RECEIVE_DRIVE_DATA, SCIP, _
                      Len(SCIP) - 4, bArrOut(0), _
                      OUTPUT_DATA_SIZE, cbBytesReturned, ByVal 0&)
  For i = 0 To NUM_ATTRIBUTE_STRUCTS - 1
      CopyMemory thr_attr, bArrOut(18 + i * Len(thr_attr)),
Len(thr_attr)
      If thr_attr.bAttrID > 0 Then
         For j = 0 To UBound(di.Attributes)
             If thr_attr.bAttrID = di.Attributes(j).AttrID Then
                di.Attributes(j).ThresholdValue =
thr_attr.bWarrantyThreshold
                Exit For
             End If
         Next j
      End If
  Next i
End Function

Private Function GetSmartVersion(ByVal hDrive As Long, VersionParams
As GETVERSIONOUTPARAMS) As Boolean
   Dim cbBytesReturned As Long
   GetSmartVersion = DeviceIoControl(hDrive, _
                     DFP_GET_VERSION, ByVal 0&, 0, _
                     VersionParams, _
                     Len(VersionParams), _
                     cbBytesReturned, ByVal 0&)
End Function

Public Function GetDriveInfo(DriveNum As IDE_DRIVE_NUMBER) As
DRIVE_INFO
    Dim hDrive As Long
    Dim VerParam As GETVERSIONOUTPARAMS
    Dim cb As Long
    
    di.bDriveType = 0
    di.NumAttributes = 0
    
    ReDim di.Attributes(0)
    
    hDrive = OpenSmart(DriveNum)
    If hDrive = INVALID_HANDLE_VALUE Then Exit Function
    If Not GetSmartVersion(hDrive, VerParam) Then Exit Function
    If Not IsBitSet(VerParam.bIDEDeviceMap, DriveNum) Then Exit
Function
    di.bDriveType = 1 + Abs(IsBitSet(VerParam.bIDEDeviceMap, DriveNum
+ 4))
    If Not CheckSMARTEnable(hDrive, DriveNum) Then Exit Function
    FillAttrNameCollection
    Call IdentifyDrive(hDrive, IDE_ID_FUNCTION, DriveNum)
    Call ReadAttributesCmd(hDrive, DriveNum)
    Call ReadThresholdsCmd(hDrive, DriveNum)
    GetDriveInfo = di
    CloseHandle hDrive
    Set colAttrNames = Nothing
End Function

Private Function IsWindowsNT() As Boolean
   Dim verinfo As OSVERSIONINFO
   verinfo.dwOSVersionInfoSize = Len(verinfo)
   If (GetVersionEx(verinfo)) = 0 Then Exit Function
   If verinfo.dwPlatformId = 2 Then IsWindowsNT = True
End Function

Private Function IsBitSet(iBitString As Byte, ByVal lBitNo As Integer)
As Boolean
    If lBitNo = 7 Then
        IsBitSet = iBitString < 0
    Else
        IsBitSet = iBitString And (2 ^ lBitNo)
    End If
End Function

Private Function SwapStringBytes(ByVal sIn As String) As String
   Dim sTemp As String
   Dim i As Integer
   sTemp = Space(Len(sIn))
   For i = 1 To Len(sIn) - 1 Step 2
       Mid(sTemp, i, 1) = Mid(sIn, i + 1, 1)
       Mid(sTemp, i + 1, 1) = Mid(sIn, i, 1)
   Next i
   SwapStringBytes = sTemp
End Function

Public Sub FillAttrNameCollection()
   Set colAttrNames = New Collection
   With colAttrNames
       .Add "ATTR_INVALID", "0"
       .Add "READ_ERROR_RATE", "1"
       .Add "THROUGHPUT_PERF", "2"
       .Add "SPIN_UP_TIME", "3"
       .Add "START_STOP_COUNT", "4"
       .Add "REALLOC_SECTOR_COUNT", "5"
       .Add "READ_CHANNEL_MARGIN", "6"
       .Add "SEEK_ERROR_RATE", "7"
       .Add "SEEK_TIME_PERF", "8"
       .Add "POWER_ON_HRS_COUNT", "9"
       .Add "SPIN_RETRY_COUNT", "10"
       .Add "CALIBRATION_RETRY_COUNT", "11"
       .Add "POWER_CYCLE_COUNT", "12"
       .Add "SOFT_READ_ERROR_RATE", "13"
       .Add "G_SENSE_ERROR_RATE", "191"
       .Add "POWER_OFF_RETRACT_CYCLE", "192"
       .Add "LOAD_UNLOAD_CYCLE_COUNT", "193"
       .Add "TEMPERATURE", "194"
       .Add "REALLOCATION_EVENTS_COUNT", "196"
       .Add "CURRENT_PENDING_SECTOR_COUNT", "197"
       .Add "UNCORRECTABLE_SECTOR_COUNT", "198"
       .Add "ULTRADMA_CRC_ERROR_RATE", "199"
       .Add "WRITE_ERROR_RATE", "200"
       .Add "DISK_SHIFT", "220"
       .Add "G_SENSE_ERROR_RATEII", "221"
       .Add "LOADED_HOURS", "222"
       .Add "LOAD_UNLOAD_RETRY_COUNT", "223"
       .Add "LOAD_FRICTION", "224"
       .Add "LOAD_UNLOAD_CYCLE_COUNTII", "225"
       .Add "LOAD_IN_TIME", "226"
       .Add "TORQUE_AMPLIFICATION_COUNT", "227"
       .Add "POWER_OFF_RETRACT_COUNT", "228"
       .Add "GMR_HEAD_AMPLITUDE", "230"
       .Add "TEMPERATUREII", "231"
       .Add "READ_ERROR_RETRY_RATE", "250"
   End With
End Sub


'********************END OF BAS MODULE********************

'In the example assume a label called label2 on a form, could easily
be a
'string etc etc....

'Add the following to your code:

' Dim drv_info As DRIVE_INFO
'
'   drv_info = GetDriveInfo(0)
'   With drv_info
'       If .bDriveType = 0 Then Label2.Caption = "[Not present]"
'       If .bDriveType = 2 Then Label2.Caption = "[ATAPI drive - info
not available]"
'       If .bDriveType = 1 Then
'       Label2.Caption = Trim(.SerialNumber)
'               End If
'   End With
'
'Label2 will display the actual physical serial number of the drive,
NOT the
'volume number.



0
erewhon (1218)
11/13/2003 1:55:55 PM
"Michael Wittmann" <e0026159@stud3.tuwien.ac.at> wrote in message
news:3fb37b36$0$16036$3b214f66@tunews.univie.ac.at...
> Hi folks,
>
> I have to write a Visual Basic 6.0 Program and need to uniquely identify a
> computer in a network and the user mustn't be able to change that id while
my
> program is running. So the Volume Serial Number of the HDD isn't a
possibility,
> because you can set the Volume SN whatever you want and therefore it's not
> unique in a Network. I heard that there's a manufacturer's Serial Number
on the
> HDD that can't be changed and that is unique (worldwide?). How can I get
that SN
> with VB6? Or do you have any other ideas? Like a BIOS SN?

What's wrong with the NIC's MAC address?

@drian.


0
nospam21 (19047)
11/13/2003 7:44:13 PM
> What's wrong with the NIC's MAC address?
There might be also single stations using my program... There's not always a
network card in the workstation

Michael

PS: Answer only to the newsgroup you read (some people already complained)

0
e0026159 (2)
11/13/2003 9:37:04 PM
"Michael Wittmann" <e0026159@stud3.tuwien.ac.at> wrote in message
news:3fb3f981$0$30786$3b214f66@tunews.univie.ac.at...
| > What's wrong with the NIC's MAC address?
| There might be also single stations using my program... There's not always a
| network card in the workstation
|
Make them buy a NIC then.

There are plenty of workstations were you cannot get a disk serial number.
RAID and poor IDE drivers.

0
Eric
11/13/2003 9:54:19 PM
On Thu, 13 Nov 2003 13:38:13 +0100, "Michael Wittmann"
<e0026159@stud3.tuwien.ac.at> wrote::

>Hi folks,
>
>I have to write a Visual Basic 6.0 Program and need to uniquely identify a
>computer in a network and the user mustn't be able to change that id while my
>program is running. So the Volume Serial Number of the HDD isn't a possibility,
>because you can set the Volume SN whatever you want and therefore it's not
>unique in a Network. I heard that there's a manufacturer's Serial Number on the
>HDD that can't be changed and that is unique (worldwide?). How can I get that SN
>with VB6? Or do you have any other ideas? Like a BIOS SN?
>
>Thanks a lot in advance,
>
>Michael
>PS: Answer in German is ok.

What about a software solution?  As you're using VB, I guess it's for
windows systems.  Under normal operating conditions, windows will lock
out file write access to all other apps if it's currently in use.
While not efficient, and not terribly secure, it will hamper
modification attempts so long as the program's running.  Just code
your app to open a filestream to the serial number file, and keep it
open until the app closes.  Just be sure to have clean up code in
place, as leaving it up to the OS can cause problems -- especially
when we're talking VB, which is flakey already.

As for uniqueness, that would be up to you to generate a unique serial
number for each installation.

If you want a hardware solution, there's the suggested MAC address
which was previously mentioned, or if you know how to do it, you could
have the program refuse to run unless the CPU ID feature is enabled.
Of course, your users would probably have issue with that.
----------------------------------------
Thanks,
MCheu
0
mpcheu (134)
11/13/2003 10:54:28 PM
@drian schrieb:

> "Michael Wittmann" <e0026159@stud3.tuwien.ac.at> wrote
> 
>>HDD that can't be changed and that is unique (worldwide?). How can I get
> 
> that SN
> 
>>with VB6? Or do you have any other ideas? Like a BIOS SN?
> 
> 
> What's wrong with the NIC's MAC address?

It can be changed by the User easily and is therefore neither Unique nor 
secure.

0
11/13/2003 11:29:56 PM
"Michael Stum" <devnull@stum.de> wrote in message
news:bp1488$ti6$03$1@news.t-online.com...
> @drian schrieb:
>
> > "Michael Wittmann" <e0026159@stud3.tuwien.ac.at> wrote
> >
> >>HDD that can't be changed and that is unique (worldwide?). How can I get
> >
> > that SN
> >
> >>with VB6? Or do you have any other ideas? Like a BIOS SN?
> >
> >
> > What's wrong with the NIC's MAC address?
>
> It can be changed by the User easily and is therefore neither Unique nor
> secure.

The MAC address?  The MAC address is a fixed, unique number embedded in the
NIC.  So how do you change the MAC on your NIC card?  I'm interested.

@drian.


0
nospam21 (19047)
11/14/2003 6:16:40 AM
"@drian" <nospam@nospam.com> wrote in message
news:cr_sb.59347$Ec1.3583836@bgtnsc05-news.ops.worldnet.att.net...
> The MAC address?  The MAC address is a fixed, unique number embedded in
the
> NIC.  So how do you change the MAC on your NIC card?  I'm interested.

I'm thinking of cable modem's that have the difficult to change MAC address.

@drian.


0
nospam21 (19047)
11/14/2003 6:27:08 AM
On Fri, 14 Nov 2003 06:16:40 GMT, "@drian" <nospam@nospam.com> wrote:

>"Michael Stum" <devnull@stum.de> wrote in message
>news:bp1488$ti6$03$1@news.t-online.com...
>> @drian schrieb:
>>
>> > "Michael Wittmann" <e0026159@stud3.tuwien.ac.at> wrote
>> >
>> >>HDD that can't be changed and that is unique (worldwide?). How can I get
>> >
>> > that SN
>> >
>> >>with VB6? Or do you have any other ideas? Like a BIOS SN?
>> >
>> >
>> > What's wrong with the NIC's MAC address?
>>
>> It can be changed by the User easily and is therefore neither Unique nor
>> secure.
>
>The MAC address?  The MAC address is a fixed, unique number embedded in the
>NIC.  So how do you change the MAC on your NIC card?  I'm interested.

The address on the card isn't necessarily the one the OS reports when
asked.  http://www.klcconsulting.net/Change_MAC_w2k.htm

-- 
Michael Cecil
macecil@comcast.net
http://home.comcast.net/~macecil/howto/
http://home.comcast.net/~antiviruscd/
0
Michael
11/14/2003 6:28:02 AM
It isn't clear to me if you need a unique session ID number, or a =
permanent and unique ID number identifying the computer, but in the case =
of sessions, you can use the CoCreateGuid API function to create a 128 =
bit number which is assured to a high degree of probability to be =
completely unique accross the world for now and in the future weather =
networked or not.

Howard Henry Schlunder

"Michael Wittmann" wrote in message =
news:3fb37b36$0$16036$3b214f66@tunews.univie.ac.at...
> Hi folks,
>=20
> I have to write a Visual Basic 6.0 Program and need to uniquely =
identify a
> computer in a network and the user mustn't be able to change that id =
while my
> program is running. So the Volume Serial Number of the HDD isn't a =
possibility,
> because you can set the Volume SN whatever you want and therefore it's =
not
> unique in a Network. I heard that there's a manufacturer's Serial =
Number on the
> HDD that can't be changed and that is unique (worldwide?). How can I =
get that SN
> with VB6? Or do you have any other ideas? Like a BIOS SN?
>=20
> Thanks a lot in advance,
>=20
> Michael
> PS: Answer in German is ok.
> 
0
howard_hs (70)
11/14/2003 9:55:15 AM
"Michael Wittmann" <e0026159@stud3.tuwien.ac.at> wrote in message news:<3fb37b36$0$16036$3b214f66@tunews.univie.ac.at>...
> Hi folks,
> 
> I have to write a Visual Basic 6.0 Program and need to uniquely identify a
> computer in a network and the user mustn't be able to change that id while my
> program is running. So the Volume Serial Number of the HDD isn't a possibility,
> because you can set the Volume SN whatever you want and therefore it's not
> unique in a Network. I heard that there's a manufacturer's Serial Number on the
> HDD that can't be changed and that is unique (worldwide?). How can I get that SN
> with VB6? Or do you have any other ideas? Like a BIOS SN?
> 
> Thanks a lot in advance,
> 
> Michael
> PS: Answer in German is ok.


Here's a way to get the BiosID:

Look here for more info:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_bios.asp


-----------------------------------------------------------
Private Declare Function GetComputerName Lib "kernel32" Alias
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Public Function GetBiosVersion() As String
    Dim strComputerName As String
    Dim objWMIService
    Dim colItems
    Dim objItem
    
    On Local Error Resume Next
    
    strComputerName = Space(255)
    GetComputerName strComputerName, 255
    strComputerName = Left(strComputerName, InStr(1, strComputerName,
Chr(0)) - 1)
    
    Set objWMIService = GetObject("winmgmts:\\" & strComputerName)
    Set colItems = objWMIService.ExecQuery("Select * from Win32_BIOS
", , 48)
    For Each objItem In colItems
        GetBiosVersion = objItem.SerialNumber
    Next
End Function
-----------------------------------------------------------------------


Reinier
0
11/14/2003 4:10:15 PM
@drian schrieb:

> "Michael Stum" <devnull@stum.de> wrote
>>It can be changed by the User easily and is therefore neither Unique nor
>>secure.
> 
> 
> The MAC address?  The MAC address is a fixed, unique number embedded in the
> NIC.  So how do you change the MAC on your NIC card?  I'm interested.

Under Linux I would issue:
"ifconfig eth0 hw ether 01:23:45:67:89:AB"
under Windows there are several Tools available. The MAC is still 
unchanged in the Card itself, but no application can read that adress 
directly - the driver reads it from the card and reports it to the 
program. And as i said: Its absolutely no Problem to tell the driver to 
report a different MAC Adress than the real one. The only way to get the 
MAC Adress directly from the card is by direct Hardware Access (Which is 
impossible under Windows NT) or by writing a Driver (which is not what 
the author wants i believe)

0
11/14/2003 7:48:36 PM
Ethernet cards have a permanent address that cannot be changed. They also have
a software address that can be set in the registry. Both can be queried by
IOCTL on NT4 and later.

If you find a way to change the permanent NIC address, you can also find a way
to change disk serial numbers.

"@drian" <nospam@nospam.com> wrote in message
news:cr_sb.59347$Ec1.3583836@bgtnsc05-news.ops.worldnet.att.net...

| > > What's wrong with the NIC's MAC address?
| >
| > It can be changed by the User easily and is therefore neither Unique nor
| > secure.
|
| The MAC address?  The MAC address is a fixed, unique number embedded in the
| NIC.  So how do you change the MAC on your NIC card?  I'm interested.
|


0
Eric
11/15/2003 4:10:43 AM
Right click the LAN icon, click the Configure button under the NIC, click
the Advanced tab and then look for "Managed Address" or "Network Address"
and enter a new MAC address.

.... you've just changed the MAC address that the network will see.


"Eric Gisin" <ericg@10.11.12.13> wrote in message
news:bp491e02he2@enews4.newsguy.com...
> Ethernet cards have a permanent address that cannot be changed. They also
have
> a software address that can be set in the registry. Both can be queried by
> IOCTL on NT4 and later.
>
> If you find a way to change the permanent NIC address, you can also find a
way
> to change disk serial numbers.
>
> "@drian" <nospam@nospam.com> wrote in message
> news:cr_sb.59347$Ec1.3583836@bgtnsc05-news.ops.worldnet.att.net...
>
> | > > What's wrong with the NIC's MAC address?
> | >
> | > It can be changed by the User easily and is therefore neither Unique
nor
> | > secure.
> |
> | The MAC address?  The MAC address is a fixed, unique number embedded in
the
> | NIC.  So how do you change the MAC on your NIC card?  I'm interested.
> |
>
>


0
Phrederick
11/15/2003 5:00:30 AM
Clueless. That's not the permanent address.

"Phrederick" <abuse@127.0.0.1> wrote in message
news:Opitb.391745$6C4.246909@pd7tw1no...
| Right click the LAN icon, click the Configure button under the NIC, click
| the Advanced tab and then look for "Managed Address" or "Network Address"
| and enter a new MAC address.
|
| ... you've just changed the MAC address that the network will see.
|
|
| "Eric Gisin" <ericg@10.11.12.13> wrote in message
| news:bp491e02he2@enews4.newsguy.com...
| > Ethernet cards have a permanent address that cannot be changed. They also
| have
| > a software address that can be set in the registry. Both can be queried by
| > IOCTL on NT4 and later.


0
Eric
11/15/2003 5:26:33 AM
No, but it's the one that the network will see, etc.

If you're just using the permanent address to track hardware, then it's a
different story.

"Eric Gisin" <ericg@10.11.12.13> wrote in message
news:bp5hlj0bpe@enews2.newsguy.com...
> Clueless. That's not the permanent address.
>
> "Phrederick" <abuse@127.0.0.1> wrote in message
> news:Opitb.391745$6C4.246909@pd7tw1no...
> | Right click the LAN icon, click the Configure button under the NIC,
click
> | the Advanced tab and then look for "Managed Address" or "Network
Address"
> | and enter a new MAC address.
> |
> | ... you've just changed the MAC address that the network will see.
> |
> |
> | "Eric Gisin" <ericg@10.11.12.13> wrote in message
> | news:bp491e02he2@enews4.newsguy.com...
> | > Ethernet cards have a permanent address that cannot be changed. They
also
> | have
> | > a software address that can be set in the registry. Both can be
queried by
> | > IOCTL on NT4 and later.
>
>


0
Phrederick
11/15/2003 6:03:47 PM
Reply:

Similar Artilces:

Visual Objects compared to Visual Basic and Visual C.
Who can explain me why I have to use VO instead of VB or VC? OR is is there no difference? With kind regards Rob van der Ploeg Rob, Every language has his (dis)advantages. The ones you mention are all wrappers around the Win32 API. VO is a very nice and easy language compared to VC. Data-access is famous with VO, but also memorymanagement, the cargage collector, ragged array's. and the result is fast and reliable code. You do not have to declare every variable if you do not want to. (but you will) Comparing to VB is VO a real OOP langangue where VB is not. You can write your own classes, inherit classes from VO classes or from your own classes, Overide methods, use both strong and loose typed variables, write early and late bound code VO comes with a SDK containing the sourcecode of the part of VO written in VO (almost everything except f.i. the compiler) With VO you get this newsgroup, where almost every question is answered within hours. VO has a prof. usergroup in the netherlands, check www.sdgn.nl. with very often very well organised conferences. I think it is the best organised usergroup in the world. VO is limitted to the Win32 api. A .NET version is announced, but withoot a releasedate yet. More inforrmation about VO can be found at www.cavo.com regards, Erik "Mobi-Data Helpdesk" <info@direcom.nl> schreef in bericht news:1070360435.358105@tbird.introweb.nl... > Who can explain me why I have to use...

GW BASIC to Visual Basic
I had done programnming in GW BASIC and Assembly 10 years back, when I was in school. Later, I learnt C,C++, Core Java and COBOL. Will my knowledge of BASIC hold me in good stead while learning Visual Basic? Is there a resemblance between the two? On 2 Mar 2005 21:11:59 -0800, "cat_dog_ass" <icon_iconoclast@hotmail.com> wrote: >I had done programnming in GW BASIC and Assembly 10 years back, when I >was in school. Later, I learnt C,C++, Core Java and COBOL. Will my >knowledge of BASIC hold me in good stead while learning Visual Basic? >Is there a resemblance between the two? A resemblance? Well, sure, they both look like Microsoft BASIC. Will knowing the one help with the other? Actually, the differences between GWB and VB are so big that you'll be learning a totally new language that reminds you of one you already know. If you learn VB.Net you might find that it also reminds you of C++ and/or Java. -- auric underscore underscore at hotmail dot com ***** If at first you don't succeed, skydiving is not for you. "cat_dog_ass" <icon_iconoclast@hotmail.com> wrote in message news:1109826719.850575.113070@o13g2000cwo.googlegroups.com... > I had done programnming in GW BASIC and Assembly 10 years > back, when I was in school . . . will my knowledge of BASIC hold > me in good stead while learning Visual Basic? If you're talking about VB6 then then answer is Yes. Much of the syntax of the language is almost iden...

Quick Basic to Visual Basic Converter
This is a multi-part message in MIME format. ------=_NextPart_000_000A_01C453DB.FEAF48A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Does anyone know of a utility that will aid in converting Quick Basic = code to Visual Basic code. I don't expect it would be perfect, but anything that would provide a = start on it would be helpful. Thanks ------=_NextPart_000_000A_01C453DB.FEAF48A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT size=3D2>Does anyone know of a utility that will aid in = converting=20 Quick Basic code to Visual Basic code.</FONT></DIV> <DIV><FONT size=3D2>I don't expect it would be perfect, but anything = that would=20 provide a start on it would be helpful.</FONT></DIV> <DIV><FONT size=3D2>Thanks</FONT></DIV></BODY></HTML> ------=_NextPart_000_000A_01C453DB.FEAF48A0-- Hmmm. Other than changes in several of the graphics methods (like CurrentX/Y versus Locate) and maybe the keyboard Get/Input they're pr...

Port Visual Basic to Visual Prolog
I'm trying to port the following Visual Basic program fragment to Visual Prolog 6.1 It opens the serial port for communications, sends a break command, switches to a specific speed, sends another command, then switches speed again, and starts listening. Any signal coming in is detected with the OnCom and displayed on the screen. This is so totally beyond my Visual Prolog skills that I have no clue how to even start porting it to Visual Prolog 6.1 Any help is appreciated!! Merel Private Sub Command1_Click() 'enable communications MSComm1.PortOpen = True &#...

US-AL-Huntsville: SW Engineer, Visual Basic, Visual C++, Visual Stdio.NET, C#; P (45288857609)
US-AL-Huntsville: SW Engineer, Visual Basic, Visual C++, Visual Stdio.NET, C#; P (45288857609) ============================================================================================== Position: SW Engineer Reference: SMC01201 Location: Huntsville AL Duration: Perm Skills: 5 + years development of MS Windows applications using Visual Basic, Visual C++, Visual Studio.NET and C#. Proficient in Microsoft Office applications (Word, Excel, PowerPoint, Outlook, Internet Explorer and Access). UML modeling experience using Rational Rose and CMM processes. Background in the development of aircraft mission planning for either the Air Force or Army and/or operation flight program (OFP) software. Please send your current resume in confidence to <staffing@eurosoft-inc.com> ..45288857609. ...

Visual Basic GUI with Visual C++ console
Hi, I'm trying to develop a system running on a PC, consisting of a Visual Basic GUI connected to a Visual C++ win32 console running in the background (which is doing most of the processing work). Inputs entered to the GUI will be processed by the win32 console and results passed back to the GUI for display again. I suppose commands and data would have to be passed between these two programs, but I have no idea how to go about doing it. Would greatly appreciate if there's anyone who could help with some ideas or point me to some helpful resources. Rgds, JG Have a look at DDE links. -- Best regards, Kyle "JG Lim" <jooghee@gmail.com> wrote in message news:70b6683c.0504041731.1a0e3b68@posting.google.com... | Hi, | | I'm trying to develop a system running on a PC, consisting of a Visual | Basic GUI connected to a Visual C++ win32 console running in the | background (which is doing most of the processing work). Inputs | entered to the GUI will be processed by the win32 console and results | passed back to the GUI for display again. | | I suppose commands and data would have to be passed between these two | programs, but I have no idea how to go about doing it. | | Would greatly appreciate if there's anyone who could help with some | ideas or point me to some helpful resources. | | Rgds, | JG On 4 Apr 2005 18:31:14 -0700, jooghee@gmail.com (JG Lim) wrote: >Hi, > >I'm trying to develop a system running on a PC, consisting of a...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288546334)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288546334) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint, Outlook, Internet Explorer and Access). UML Modeling (using Rational Rose) and CMM Level 3 activities. Development of aircraft mission planning and/or operation flight program (OFP) software. Please send your current resume in confidence to <staffing@eurosoft-inc.com> ..45288546334. ...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288832412)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288832412) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: SW Engineer, Visual Basic, Visual C++, Visual Stdio.NET, C#; P (45288546624)
US-AL-Huntsville: SW Engineer, Visual Basic, Visual C++, Visual Stdio.NET, C#; P (45288546624) ============================================================================================== Position: SW Engineer Reference: SMC01201 Location: Huntsville AL Duration: Perm Skills: 5 + years development of MS Windows applications using Visual Basic, Visual C++, Visual Studio.NET and C#. Proficient in Microsoft Office applications (Word, Excel, PowerPoint, Outlook, Internet Explorer and Access). UML modeling experience using Rational Rose and CMM processes. Background in the development of aircraft mission planning for either the Air Force or Army and/or operation flight program (OFP) software. Please send your current resume in confidence to <staffing@eurosoft-inc.com> ..45288546624. ...

US-AL-Huntsville: SW Engineer, Visual Basic, Visual C++, Visual Stdio.NET, C#; P (45289157611)
US-AL-Huntsville: SW Engineer, Visual Basic, Visual C++, Visual Stdio.NET, C#; P (45289157611) ============================================================================================== Position: SW Engineer Reference: SMC01201 Location: Huntsville AL Duration: Perm Skills: 5 + years development of MS Windows applications using Visual Basic, Visual C++, Visual Studio.NET and C#. Proficient in Microsoft Office applications (Word, Excel, PowerPoint, Outlook, Internet Explorer and Access). UML modeling experience using Rational Rose and CMM processes. Background in the development of aircraft mission planning for either the Air Force or Army and/or operation flight program (OFP) software. Please send your current resume in confidence to <staffing@eurosoft-inc.com> ..45289157611. ...

Newbie question: Quick Basic to Visual Basic
Program migration from Quick Basic to Visual Basic ? Regards to the newsgroup. Excuse my sudden intromission into the group, but I know from my long experience in these groups that there are a lot of people willing to help. As I ceased to program several years ago I found myself in the situation that my old programs are incompatible with Windows 98 and XP. I have code written in 1995 to 97 under DOS, using Quick Basic, which running under Windows, create problems when they write data files on to the fixed disk. I'm having trouble when restarting my PC. I guess this is due to the protection of the fixed disk by Windows. Mi question is: Is there a way of importing or converting my old codes into Visual Basic ? or Shall I have to write them again ? Thanks in advance. Juan Vazquez P.S.: I'm having the same problem with Borland Turbo Pascal and DELPHI. Is there a way of importing or converting my old Pascal programs into DELPHI ? "Juan Vazquez" <j.vazquez@_emavenca.com> wrote in message news:cu69ov$t5o$1@newsreader.mailgate.org... > > > > Program migration from Quick Basic to Visual Basic ? > > Regards to the newsgroup. > > Excuse my sudden intromission into the group, but I know from my long > experience in these groups that there are a lot of people willing to help. > > As I ceased to program several years ago I found myself in the situation > that my old programs are incompatible with Window...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint, Outlook, Internet Explorer and Access). UML Modeling (using Rational Rose) and CMM Level 3 activities. Development of aircraft mission planning and/or operation flight program (OFP) software. Please send your current resume in confidence to <staffing@eurosoft-inc.com> ..45288557613. ...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288857609)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288857609) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288832412)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288832412) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint...

Quick-Basic running in a Visual Basic compilation?
Hi everybody, I have a program, developed in Quick Basic under DOS, which are quite complicated and I wish to translate into Visual Basic, since Basic is more familiar for me than other languages. The question is how to write Quick Basic code in a Visual Basic program. It handles I/O commands and direct access to memory addresses for a A/D card. I have to say that this program works fine in a DOS window under Win98, but it's not the case for W2000/XP. Any comment will be highly appreciated. / Bish "Bishop" <Donottry@never.de> wrote in message news:c14po4$1efl2s$1@ID-145933.news.uni-berlin.de... > Hi everybody, > > I have a program, developed in Quick Basic under DOS, which are quite > complicated and I wish to translate into Visual Basic, since Basic is more > familiar for me than other languages. > The question is how to write Quick Basic code in a Visual Basic program. It > handles I/O commands and direct access to memory addresses for a A/D card. > I have to say that this program works fine in a DOS window under Win98, but > it's not the case for W2000/XP. > Any comment will be highly appreciated. I'll say you're in for a bit of work! Your program must be completely re-structured. VB is Event-driven, and doesn't like top-town and procedural code at all. THis, in it self isn't neccessarily a show-stopper, as long as your QB code is reasonably structured, but the *big* problem here, is the I/O and...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45288557613) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel, PowerPoint, Outlook, Internet Explorer and Access). UML Modeling (using Rational Rose) and CMM Level 3 activities. Development of aircraft mission planning and/or operation flight program (OFP) software. Please send your current resume in confidence to <staffing@eurosoft-inc.com> ..45288557613. ...

US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289157610)
US-AL-Huntsville: Sr. SW Eng., Visual Basic, Visual C++, Visual Studio.NET, C#; (45289157610) ============================================================================================= Position: Sr. SW Eng. Reference: SMC01200 Location: Huntsville AL Duration: Perm Skills: 5+ years in development of Microsoft Windows applications using Microsoft tools and technologies such as Visual Basic, Visual C++, Visual Studio.NET and C#. Must be proficient in the use of Microsoft Office applications (Word, Excel...

US-AL-Huntsville: SW Engineer, Visual Basic, Visual C++, Visual Stdio.NET, C#; P (45288546624)
US-AL-Huntsville: SW Engineer, Visual Basic, Visual C++, Visual Stdio.NET, C#; P (45288546624) ============================================================================================== Position: SW Engineer Reference: SMC01201 Location: Huntsville AL Duration: Perm Skills: 5 + years development of MS Windows applications using Visual Basic, Visual C++, Visual Studio.NET and C#. Proficient in Microsoft Office applications (Word, Excel, PowerPoint, Outlook, Internet Explorer and Access). UML modeling experience using Rational Rose and CMM processes. Background in the development of aircraft mission planning for either the Air Force or Army and/or operation flight program (OFP) software. Please send your current resume in confidence to <staffing@eurosoft-inc.com> ..45288546624. ...

Vista Basic or Visual Basic conversation to VB.Net
Hello, I have a piece of code written in Vista Basic (similar to Visual Basic), and I'd like to know if you could help me find the equivalent in VB.NET? Here is the code: local lcopr as character store upper(this.value) to lcopr opentable("joprs") ordertable("joprs","joopr") seek("joprs", lcopr) store db.joprs.jodesc.value to thisform.textbox1.value store db.joprs.joextd.value to thisform.editbox1.value closetable("joprs") The code above is triggered when a user enters text into textboxA, which has a "CHANGE" trigger assigned to it. When the value is entered in to textboxA, textbox1 is populated with store.db.joprs.jodesc.value, and finally, editbox1 is populated with db.joprs.joextd.value. Any help or guidance would be greatly appreciated. Regards, --TJ ...

Accessing BTrieve database from Visual C++/Visual Basic
Hi! I have been looking on the pervasive website but things don't get really clear to me. Does anybody know how to access a betrieve database from either Visual Basic or from Visual C++? Is there some sort of ODBC driver or anything alike? Do you know where to get it and if it is free or needs to be payed for? I'm looking for this because we use a product in our clinic that makes use of a BTrieve database from which we would like to query some information that we would like to use in some other system. If we can access the BTrieve database we are able to treat our patient be...

labview vs visual basic vs visual C
Hi, &nbsp; I am hoping to get advice about LabVIEW vs Visual&nbsp;Basic/C for developing education software.&nbsp; I have programmed in LabVIEW for test and measurement applications.&nbsp; I have also programmed a couple of short programs in C , but have never programmed in Visual C or Visual basic.&nbsp; I want to develop software for educational purposes for students with special needs such as spelling and reading comprehension programs.&nbsp; These programs would involve a lot of displaying text, graphics and sounds to the students and measuring student inputs via text or clicks on buttons to determine whether they need additional&nbsp;help from the computer to learn the lessons.&nbsp; I was was wondering if anyone has the knowledge to advise using LabVIEW vs Visual C vs Visual Basicfor such programming tasks? &nbsp; I am guessing that Visual C and Visual Basic&nbsp;may have more flexibility in displaying text, graphics, sounds etc. since&nbsp;this is mostly what&nbsp;they used for.&nbsp; On the other hand, I am famliar with the ease of coding in LabVIEW for test/measurement applications&nbsp;but wondering if there might be limitations or difficulties in programming with LabVIEW for a more general purpose windows application such as the education software I am planning.&nbsp;&nbsp; I would have to learn Visual C or Visual Basic, but if those environments would be easier&nbsp;or better&nbsp;in ...

Re: macros written in visual basic and visual studio 2005
Wrong newsgroup but I can help a bit. Visual Basic and Visual Basic.NET have 2 things in common: the words "visual" and "basic". There was an attempt to minimize some language changes but EVERYTHING under the surface is different. Printing reports in VB.NET shouldn't be an issue but I would look toward using the old macro as a 'template' and not for a code lift. Look into Microsoft's Visual Studios Tools for Office (VSTO) or Aspose's class libraries to transfer your reports over to VS2005. Now VS2005 is the best way to go so you are moving in the right direction. http://msdn2.microsoft.com/en-us/library/aa830702.aspx Now, I personally don't use VSTO since it relies on the old COM interface but it should work fine for lightweight applications. I would convert your code and revel in a much better interface and a much cleaner way of doing things. Plus, it doesn't require Office to be installed to use it. Alan Alan Churchill Savian "Bridging SAS and Microsoft Technologies" www.savian.net -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Munna Sent: Monday, October 30, 2006 1:02 PM To: SAS-L@LISTSERV.UGA.EDU Subject: macros written in visual basic and visual studio 2005 hi I have a macro that is written in visual basic. it is simple macro, all it does is just grab the report and prints it in pdf format. I am trying to use the same macro in microsoft visual studio 200...

Web resources about - Get the Serial Number with Visual Basic - comp.lang.basic.visual.misc

Serial - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Serial Innovation
This is a very interesting site done by Brendan Steidle. He doesn’t just point out problems with a company or industries, he tries to offer solutions ...

Serial rapist to be held in jail indefinitely
A habitual criminal who raped a five-year-old girl less than a fortnight after his 14th birthday will remain behind bars indefinitely.

Australia’s worst serial killer Ivan Milat provides his thoughts in letters
AUSTRALIA’S most infamous serial killer Ivan Milat has provided astonishing insights into his mind and life behind bars in a series of letters ...

Police hunt for serial creep in south-west Sydney
Police believe the same man may be behind a string of attempted child assaults across&nbsp;Sydney's south-west in recent days.

WA serial killer Catherine Birnie refused parole again
West Australian serial killer Catherine Birnie has again been denied parole.

Suspected Indiana serial killer faces new charges
Police say Darren Vann confessed to killing seven women; bodies were found in 2014 in abandoned buildings in northwest Indiana

Coroner's office says serial killer died of heart disease
NEW ORLEANS (AP) — Officials in Louisiana say serial killer Derrick Todd Lee, who was suspected of killing seven women, died of heart disease. ...

C&L's Sat Nite Chiller Theater: 'Henry: Portrait Of A Serial Killer '
Henry , was a serial killer movie that was so convincingly real, it took five years to make it to the big screen. Indiewire writes: Serial ...

‘I Am Not A Serial Killer’ SXSW Clip: Doc Brown Has A Dark Side?
EXCLUSIVE: Adapted from the first installment of the John Cleaver novel series by Dan Wells , I Am Not A Serial Killer stars Max Records ( Where ...

Resources last updated: 3/25/2016 12:41:43 AM