问题
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