Search local host name with API... 
Author Message
 Search local host name with API...

This is an example to get the user name

Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal
lpBuffer As String, nSize As Long) As Long

Dim Name$, Success&
    Name= Space(100)
    Success = GetUserName(Name, 100)
    MsgBox "You are logged on as: " & Trim(Name),  vbInformation

Rgis LYARD - BOZON Informatique (FRANCE)


Quote:
>I research a API to found the local host name (like the VB winsock control)
>+ACEAIQAh-

>Thanks for your help
>Manok



Fri, 09 Mar 2001 03:00:00 GMT  
 Search local host name with API...
:I research a API to found the local host name (like the VB winsock control)

Declare Function gethostname Lib "winsock.dll" (name As String, ByVal
namelen As Long) As Long
Dim pHostName As String * 32
If (gethostname(pHostName,Len(pHostName)) = 0) Then
 '  succeded
Else
 ' error
End If
--
Damit Senanayake
ICQ#: 6930718
#include <stdio.h>
#include <ctype.h>
void main(){ const char*
s="\x044\x061\x06D\x069\x074\x020\x069\x073\x020\x040\x020\x061\x06C\x074\x0
61\x076\x069\x073\x074\x061\x02E\x06E\x065\x074"; char d[24]; for(int
i=0;i<25;i++) {d[i]=toascii(s[i]);} puts(d);}



Fri, 09 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Search local host name with API...

2. Search local host name with API...

3. HOW TO GET HOST NAME FROM THE IP ADDRESS USING WINDOWS API

4. How to get the login Name of the Remote machine, I am having the host name

5. NetBIOS Name & Host Name

6. Retrieving Servers Names (Not local machine name)

7. FileSystemObject Write to Local Drive from Remote Host?

8. shutting down, rebooting, power down local host???

9. Copy file from local machine to web host

10. Winsock Control SP2 - many IP Address on Local Host

11. 501 Error When Setting Local Host?

12. Name of host running Access97?

 

 
Powered by phpBB® Forum Software