Jump to content

[C#] trying to disable a NetworkInterface

Go to solution Solved by technovore,

running the my code with admin priviliges fixes it

Hey guys, I'm creating little tool to manage my NetworkInterfaces.
I've looked all over the web for a way to disable a nic. I've already got an instance of it.

http://i.imgur.com/9RG2A9s.png

9RG2A9s.png

 

Neither of these methods actually manage to disable the nic :(
(yes i know the second isn't being called)

Doesn anyone know another method?

many thanks xx!

Grammar nazis are people too!
Treat your local grammar nazi nicely and he might teach you a thing or two. (Note that I'm Belgian and not a native English speaker.)
Chivalry isn't dead!

Link to comment
Share on other sites

Link to post
Share on other sites

posted on stackoverflow like I should've in the first place:
http://stackoverflow.com/questions/30437346/c-sharp-trying-to-disable-a-networkinterface

Grammar nazis are people too!
Treat your local grammar nazi nicely and he might teach you a thing or two. (Note that I'm Belgian and not a native English speaker.)
Chivalry isn't dead!

Link to comment
Share on other sites

Link to post
Share on other sites

What is Interface.Name? I just tried the first method and replaced that with "Wireless Network Connection" and it disabled that connection.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

running the my code with admin priviliges fixes it

Grammar nazis are people too!
Treat your local grammar nazi nicely and he might teach you a thing or two. (Note that I'm Belgian and not a native English speaker.)
Chivalry isn't dead!

Link to comment
Share on other sites

Link to post
Share on other sites

What is Interface.Name? I just tried the first method and replaced that with "Wireless Network Connection" and it disabled that connection.

it's just the name of the NetworkInterface. but I fixed it now, just needed admin privgs.

Grammar nazis are people too!
Treat your local grammar nazi nicely and he might teach you a thing or two. (Note that I'm Belgian and not a native English speaker.)
Chivalry isn't dead!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×