Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

KenLin

macrumors newbie
Original poster
Jul 3, 2007
4
0
Dear All,
I want to change IP address via cocoa's API or other function.
Is anyone knows how to change IP in program?

Thanks!
Ken Lin in trouble :apple:
 

KenLin

macrumors newbie
Original poster
Jul 3, 2007
4
0
Dear janey:
I want to write a program to change IP easier via cocoa.

Thanks,
Ken
 

janey

macrumors 603
Dec 20, 2002
5,316
0
sunny los angeles
Dear Ken,

My question is asking you why one would want to change an IP address in such a manner when there are so many things that factor into this that the end user does not have control over?

Thanks,
Jane
 

KenLin

macrumors newbie
Original poster
Jul 3, 2007
4
0
Dear Ken,

My question is asking you why one would want to change an IP address in such a manner when there are so many things that factor into this that the end user does not have control over?

Thanks,
Jane
_______
Dear Jane:
Because i want to write a wireless dongle program, and i need to change / specify dongle's host IP address.

Thanks
Ken
 

blaster_boy

macrumors 6502
Jan 31, 2004
282
4
Belgium
You could always do a shell out from your program to launch ifconfig with the required settings to change the ip address.
 

lancestraz

macrumors 6502a
Nov 27, 2005
898
0
RI
You can do this in Terminal.
Code:
sudo ifconfig en1 inet 192.168.0.1
And I imagine you can run a shell script via cocoa.
 

KenLin

macrumors newbie
Original poster
Jul 3, 2007
4
0
Thanks: Jane, blaster_boy & lancestraz:

Yes, shell script can work.
Do u have any other method to change IP address? like API or other functions?

Ken
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.