• 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
Getting the computer name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Getting the computer name


  • Subject: Getting the computer name
  • From: Tim Hewett <email@hidden>
  • Date: Tue, 14 Dec 2004 15:40:30 +0000

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"?

BTW I have more or less cracked performing drag and drop
from a NSBrowser (including creating a drag image from
visible multiply-selected items - not trivial at all). I can post
sample code but if someone knows that something good
already exists then please tell me so I can see if my approach
is over-complex. There doesn't appear to be anything in
/Developer/Examples or at developer.apple.com. It is a
subject that seems to crop up regularly so I'd be happy to
post some sample code if anyone is interested. It was based
on a sample posted by someone here about a year ago but
has been enhanced quite a bit

Regards,

Tim.

_______________________________________________
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


  • Follow-Ups:
    • Re: Getting the computer name
      • From: Charles Yeomans <email@hidden>
    • Re: Getting the computer name
      • From: Frederick Cheung <email@hidden>
  • Prev by Date: Setting tooltips for a NSMatrix
  • Next by Date: Re: Handling right click only
  • Previous by thread: [SOLVED] Re: Setting tooltips for a NSMatrix
  • Next by thread: Re: Getting the computer name
  • Index(es):
    • Date
    • Thread