• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting the computer name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting the computer name


  • Subject: Re: Getting the computer name
  • From: Charles Yeomans <email@hidden>
  • Date: Tue, 14 Dec 2004 11:53:06 -0500


On Dec 14, 2004, at 10:40 AM, Tim Hewett wrote:

Hello,

I've scoured the manuals, can't seem to find this. I need to
get the name of the computer, e.g. "Fred Blogg's Computer".
I've tried gethostname() but this gives "Fred-Blogg's-
Computer.local", and this changes to something set by the
network service provider when you go online.

Is there some function which will always return the actual
computer name in the form of "Fred Blogg's Computer"?


If you don't mind a bit of Carbon code, use CSCopyMachineName.

CFStringRef CSCopyMachineName ();

NSString and CFString are, of course, toll-free bridged.

--------------
Charles Yeomans

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Getting the computer name (From: Tim Hewett <email@hidden>)

  • Prev by Date: Re: How Do I Run a Java App with Superuser Privileges?
  • Next by Date: iCal SDK
  • Previous by thread: Re: Getting the computer name
  • Next by thread: Re: Getting the computer name
  • Index(es):
    • Date
    • Thread