Get computer name in VB6
-
You will need this in a module:
Declare Function GetComputerName Lib "kernel32.dll" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Then in your code:
Dim compname As String, retval As Long
compname = Space(255)
retval = GetComputerName(compname, 255)
compname = Left(compname, InStr(compname, vbNullChar) - 1)HTH Nick Parker
-
I have a code which is less complex you will have to import import system.net.dns Sample code is as follows: Imports System.Net.Dns Dim shostname As String shostname = system.Net.DNS.GetHostName() console.writeline("Your Machine Name = " & shostname) hope that helps
-
I have a code which is less complex you will have to import import system.net.dns Sample code is as follows: Imports System.Net.Dns Dim shostname As String shostname = system.Net.DNS.GetHostName() console.writeline("Your Machine Name = " & shostname) hope that helps
-
ohh you are right thats possible in VB.NET
-
No Problem, you should consider becoming a member. :) Nick Parker