110,537
社区成员
发帖
与我相关
我的任务
分享
Shell32.Shell sh = new Shell32.Shell();
Shell32.Folder folders;
folders = sh.NameSpace(3);
comboBox1.Items.Clear();
//进入控制面板列表
foreach (Shell32.FolderItem myItem in folders.Items())
{
//找到网络连接
if (myItem.Name == "网络连接")
{
Shell32.Folder fd = (Shell32.Folder)myItem.GetFolder;
//获取网络连接下所有内容
foreach (Shell32.FolderItem fi in fd.Items())
{
comboBox1.Items.Add(fi.Name.ToString());
comboBox1.SelectedItem = comboBox1.Items[0];
if (fi.Name.ToString() == "本地连接")
{
//获取本地连接下所有 右键
foreach (Shell32.FolderItemVerb Fib in fi.Verbs())
{
if (Fib.Name == "启用(&A)" || Fib.Name == "停用(&B)")
{
Fib.DoIt();
break;
}
}
}
}
}
}
//找到网络连接
if (myItem.Name == "网络连接")
//找到网络连接
if (myItem.Name == "网络和共享中心")