홈 · 개발 참고자료

개발 참고자료

[파워빌더] gethostname 이 작동안될때...

작성자
관리자
작성일
2017-11-28
조회
11308
분류
파워빌더
----------------------------------------------------------


Function uint gethostname (ref String szHost, long dwHostLen) Library "wsock32.dll" alias for "gethostname;Ansi"


FUNCTION boolean GetUserNameA(ref string uname, ref ulong slength) LIBRARY "ADVAPI32.DLL" Alias For "GetUserNameA;Ansi"
Function boolean GetComputerNameA (ref string lpBuffer, ref ulong nSize) Library "kernel32.dll" Alias For "GetComputerNameA;Ansi"


--------------------------------------------------------------




String ls_HostName


ls_HostName = space(128)
this.gethostname ( ls_HostName, len(ls_HostName) )
ls_HostName = this.n2b(ls_HostName)
if ls_HostName = "" then
ulong lu_val
lu_val = 255
ls_HostName = Space( 255 )
GetComputerNameA (ls_HostName, lu_val)
end if


ls_HostName = trim(ls_HostName)


Messagebox("", ls_HostName)
Return ls_HostName