PureBasic Forum
https://www.purebasic.fr/english/

[Done] Wrong machine name
https://www.purebasic.fr/english/viewtopic.php?f=24&t=72842
Page 1 of 1

Author:  mk-soft [ Sat May 18, 2019 1:13 am ]
Post subject:  [Done] Wrong machine name

The Purebasic version returns the wrong machine name when virtual machines are running.
Quote:
[02:07:34] current Host = vm-win7.fritz.box
[02:07:34] localized Name = Michaels Mac mini
[02:07:34] PB CompuerName = vm-win7.fritz.box


Second run
Quote:
[02:11:00] current Host = michaels-mac-mini.local
[02:11:00] localized Name = Michaels Mac mini
[02:11:00] PB CompuerName = vm-win7.fritz.box


Code from wombats
Code:
host = CocoaMessage(0, 0, "NSHost currentHost")

hostName = CocoaMessage(0, host, "name")
string = CocoaMessage(0, hostName, "UTF8String")
Debug "current Host = " + PeekS(string, -1, #PB_UTF8)

localisedName = CocoaMessage(0, host, "localizedName")
string = CocoaMessage(0, localisedName, "UTF8String")
Debug "localized Name = " +PeekS(string, -1, #PB_UTF8)

Debug "PB CompuerName = " + ComputerName()

Author:  Fred [ Fri Aug 09, 2019 1:48 pm ]
Post subject:  Re: Wrong machine name

Fixed.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/