|
//禁用 SetNetworkAdapter(False) //启用 SetNetworkAdapter(True) //增加援用system32/shell32.dll private static bool SetNetworkAdapter(bool status) { const string discVerb = "停用(&B)"; // "停用(&B)"; const string connVerb = "启用(&A)"; // "启用(&A)"; const string network = "网络连接"; //"网络衔接"; const string networkConnection = "VMware Network Adapter VMnet1"; // "本地连接" string sVerb = null;  ,c 如何输入01 02.。。。在按原样输出(不要自定义函数); if (status) { sVerb = connVerb; } else { sVerb = discVerb; } Shell32.Shell sh = new Shell32.Shell(); Shell32.Folder folder = sh.NameSpace(Shell32.ShellSpecialFolderConstants,B超查出甲状腺弥漫性重大该如何治疗.ssfCONTROLS); try {  ,B型血水瓶座 女的命运如何; //进入把持面板的所有选项 foreach (Shell32.FolderItem myItem in folder.Items()) {  ,byshell这类病毒如何防止啊?; //进入网络连接 if (myItem.Name == network) { Shell32.Folder fd = (Shell32.Folder)myItem.GetFolder;  ,BYD汽车如何 ???; foreach (Shell32.FolderItem fi in fd.Items())  ,BT下载如何安装呢?; { //找到本地连接 if ((fi.Name == networkConnection)) { //找本地连接的所有右键功效菜单 foreach (Shell32.FolderItemVerb Fib in fi.Verbs()) { if (Fib.Name == sVerb) { Fib.DoIt(); return true; } } } } } } } catch (Exception e) { Console.WriteLine(e.Message); return false; } return true; }
(责任编辑:admin)
|
|