Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: RE: Getting the Computer Name



You are missing the point.... I know I can go into the control panel and
get it.... I want to set it with a RB program similar to the method below
in which you can get the name of the computer via a program. I want to be
able to set the name via a program. I am just trying to find out if it can
be done and I am assuming that if you can get it you can set it..... make
sense?

>Go to the filesharing control panel
>
>> ----------
>> From: Dan Rahenkamp
>> Sent: January, 22 2001, 12:37 PM
>> To: email@hidden
>> Subject: Re: Getting the Computer Name
>>
>> Is there also a way to replace the computer name and owner name with a
>> string of your choosing? Thanks in advance.
>>
>> >Subject: Re: Getting the Computer Name
>> >From: "winjer" <email@hidden>
>> >Date: Sat, 20 Jan 2001 03:30:30 +0000
>> >
>> >Travis J. Hicks wrote:
>> >
>> >>I have a quick question. How can I get the computer name, as set in
>the
>> >>File Sharing control panel, in REALbasic? Can I get it via a system
>> >gestalt
>> >>value or via an Apple Event?
>> >
>> >Either from the System resource:
>> >
>> >Function ComputerName() As String
>> > Dim r, mch as String
>> > Dim Length as Integer
>> > r = App.ResourceFork.GetResource("STR ", -16413) // Owner is -16096
>> > Length = Asc(Left(r, 1))
>> > mch = Mid(r, 2, Length)
>> > Return mch
>> >End Function
>> >
>> >or with an AppleEvent:
>> >
>> >Function ComputerName() As String
>> > Dim ae as AppleEvent
>> > ae = NewAppleEvent("mchn", "getd", "MACS") // Change mchn to ownn
>> > If ae.send then // to get the owner
>> > Return ae.ReplyString
>> > End if
>> >End Function
>> >
>> >I don't think there's a gestalt for this.
>> >
>> >winjer
>> >--
>> >Don't *type* defaults...
>> ><http://jxzz.com/software/osx/>
>> _______________________________________________
>> macintosh-manager mailing list
>> email@hidden
>> http://www.lists.apple.com/mailman/listinfo/macintosh-manager




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.