Jump to content
Tuts 4 You

Local Area Connection - Controll


eXec0d3

Recommended Posts

'Start > Control Panel > Network Connections' then select the connection you want to disable and right click it, then disable via the context menu. Else you can right click the icon on the system tray and disable it via there but on some setups the icon will then disappear and you will have to go into the control panel to re-enable it anyway.

Code wise, you haven't given a target language or anything, so its a bit much to expect people to throw solutions for every possibility. :D

HR,

Ghandi

Edited by ghandi
Link to comment

how can I change my Local Area Connection settings or disable/enable it... :)

thanks

After making com interface to the Microsoft Shell Controls And Automation (SHELL32.dll),Then you can do the following:

oshell as IShellDispatch

ofolder as folder

ofolderitems as FolderItems

ofolderitem as FolderItem

oFolderItemVerbs as FolderItemVerbs

FolderItemVerb as FolderItemVerb

oshell=newcom "ProgID"

ofolder=oshell.namespace(NETWORK_CONNECTIONS). // by folder method namespace

ofolderitems=ofolder.items // these are your nework connections. by FolderItems method items

ofolderitems.count() // this is the # of your connections . by FolderItems property count

cycle through your items

oFolderItemVerbs= ofolderitems.item(your index).verbs() // these would be the right click menu items. by FolderItems method item

oFolderItemVerbs.count() // these are the # of the right click menu items. by FolderItemVerbs property count

FolderItemVerb=oFolderItemVerbs.item(your index). // cycle through menu

FolderItemVerb.name() // by this you can check the menu if "En&able" or "Disa&ble"

after that you can act on it by using FolderItemVerb.doit(); if name ="En&able" will enable your network in question,if "Disa&ble" will disable it .

you can act on others as well , rename , delete and so on ...

please note, these are only steps you can translate them to your compiler codes.

Edited by britedream
Link to comment

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
×
×
  • Create New...