eXec0d3 Posted July 9, 2010 Posted July 9, 2010 how can I change my Local Area Connection settings or disable/enable it... thanks
ghandi Posted July 10, 2010 Posted July 10, 2010 (edited) '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. HR, Ghandi Edited July 10, 2010 by ghandi
v01d Posted July 11, 2010 Posted July 11, 2010 You can use WMI to control the network adapter. Here is a link with useful informationhttp://msdn.microsoft.com/en-us/library/Aa394595
britedream Posted July 14, 2010 Posted July 14, 2010 (edited) 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 July 14, 2010 by britedream
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now