0

Possible Duplicate:
How can you change Network settings (IP Address, DNS, WINS, Host Name) with code in C#

Developing a program(C#/ winForm) that can change the ip and dns setting with a limited user account.

Inititally, My Program is developed based on the following Code Project example: SwitchNetConfig - Laptop users, quickly switch network and proxy configuration in different places

However, I find that this program won't work under a limited user account due to privilege problems

After doing some researches, I know that I can implement this function by

  1. building & installing the service [runs under the LocalSystem account]
  2. creating a small client that can be run in limited user mode that would command the service to change the IP and dns setting.

[Idea comes from: IP Address change with limited account ]

However, I still do not have any idea about how to how to communicate with service and command the service to change the IP and dns setting according to the input from the user [ in a winForm Program].

I would appreciate it if you could share some ideas or examples with me.

Community
  • 1
  • 1
Eric
  • 357
  • 1
  • 4
  • 14
  • Ok, so basically your question is totally not what you say, correct? YOu dont care about limited user account blablabla, the real question is "how do I Change the IP and DNS Settings from code", because the code will not run in limtied account, but in a Service with LocalSystem rights, and the rest is just useless Information. Care to expand the qeustion with the lunch you had? Same relevance. – TomTom Jan 01 '13 at 11:22
  • Total duplicate once you gut out all the useless side Information provided by the poster. Note that the "limited user account" is irrelevant as the poster already tells how he handles NOT doing it from a limited user account. – TomTom Jan 01 '13 at 11:25
  • 1
    @TomTom It is either that or [how do I implement communication between two process](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx). – rene Jan 01 '13 at 11:25
  • @rene no, because the poster already says he knows he can implement this. Note Point 2 of his "I know how to do that" list. – TomTom Jan 01 '13 at 11:26
  • @TomTom : Sorry for bad organized, I have modified my question and made it in a more clear way .... – Eric Jan 01 '13 at 12:05
  • @rene Sorry for bad organized, I have modified my question and made it in a more clear way – Eric Jan 01 '13 at 12:17

1 Answers1

0

Simple. Once you realize you are really really really bad at asking questions and skip all the irrelevant crap you wrote out, you are left with a simple question:

How do I Change Network Settings in C#?.

WInforms - irrelevant. Limited user account - irrelevant. Explanations how you do communicate - irrelevant. Your lunch - irrelevant, too, thank heaven you did not include that.

And then, what is left, is a duplicate of How can you change Network settings (IP Address, DNS, WINS, Host Name) with code in C#

Simple like that.

Because according to your question everything except the Change is in place - a Windows Service, talking to the Client that commands it. This is really totally useless Information for the question you ask.

Community
  • 1
  • 1
TomTom
  • 61,059
  • 10
  • 88
  • 148
  • First of all, Thankyou for your reply. May be I should say in a more clear way. My program is developed with winForm based on the following example: http://www.codeproject.com/Articles/6975/SwitchNetConfig-Laptop-users-quickly-switch-networ However, I find that this program won't work under a limited user account due to privilege problems. Therefore, I try to create a service and runs it under the LocalSystem account. However, I do not have ideas on how to communicate with service and command the service to implement the request. – Eric Jan 01 '13 at 11:53
  • That are two questions, so make them two. – TomTom Jan 01 '13 at 12:18