Display Name
Display Name

Reputation: 1035

How to programmatically set IP address on Windows 7 using C

I am developing an application that requires the ability to be able to set the IP address.

Using command prompt

Netsh interface IP set address....

It works but what is the equivalent in c?

Thanks

Upvotes: 1

Views: 2284

Answers (2)

user5574945
user5574945

Reputation:

You need to use system command in c which is a very helpful command in executing command prompt commands.for ex system('watever command you can type here');

Upvotes: -2

Prasanna
Prasanna

Reputation: 1274

I think you need AddIPAddress() API.

Refer to AddIPAddress function at MSDN documentation with a good example.

You can refer to a majority of networking APIs (query, set, delete IPs etc) at https://msdn.microsoft.com/en-us/library/windows/desktop/aa366071(v=vs.85).aspx.

Upvotes: 3

Related Questions