How to get the host name and ipv4 address in Powerbuilder 2019?

让人想犯罪 __ 提交于 2021-02-11 12:32:15

问题


I would like to create a log of connections to the database with the user name, computer name, and ipv4 address, but using calls to the kernel32.dll gets me garbage characters, like 䍐䌭位剎奏. I was thinking on something along the lines of:

$computer = [System.Net.Dns]::GetHostName() $ipcomputer = [System.Net.Dns]::GetHostEntry($computer)

assuming I can get those values back to PB2019. Any ideas will be appreciated.


回答1:


The garbage the function spits needs to be converted to ANSI before making any sense. Thanks to @Slapout for the link that helped me solve this.



来源:https://stackoverflow.com/questions/65094693/how-to-get-the-host-name-and-ipv4-address-in-powerbuilder-2019

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!