Change the computer name

This will help you to change the computer name.
Works with VB6 and .net
The Code:
Declare Function SetComputerName Lib "kernel32" _
Alias "SetComputerNameA" (ByVal lpComputerName As String) As _
Long
Public Function ChangeComputerName(sNewComputerName As String) _
As Boolean

On Error Resume Next
Dim nReturn As Long

nReturn = SetComputerName(sNewComputerName)
If Err.Number = 0 Then
ChangeComputerName = nReturn <> 0
End If

End Function

Change the computer name

This will help you to change the computer name.
Works with VB6 and .net
The Code:
Declare Function SetComputerName Lib "kernel32" _
Alias "SetComputerNameA" (ByVal lpComputerName As String) As _
Long
Public Function ChangeComputerName(sNewComputerName As String) _
As Boolean

On Error Resume Next
Dim nReturn As Long

nReturn = SetComputerName(sNewComputerName)
If Err.Number = 0 Then
ChangeComputerName = nReturn <> 0
End If

End Function

Age Calculation with VB6 or .net

This is a simple utility to calculate age. e.g, if the age is 4 months then it will display in months, if age is 2 years it will display in years. Example of the DateDiff funtion in VB.

'Just place a command button and text box controls on your form.
'Enter a date of birth in the text box and it will calculate age based on the current date.
Private Sub Command1_Click()
If (Int(DateDiff("y", CDate(Text1.Text), Date)) / 365.25) > 1 Then
MsgBox Round((Int(DateDiff("y", CDate(Text1.Text), Date)) / 365.25)) & " Years"
Else
MsgBox (Mid((Int(DateDiff("y", CDate(Text1.Text), Date)) / 365.25), 1, 3)) * 10 & " Months"
End If
End Sub