摘要: 修改注册表后不重启计算机并生效。const int WM_SETTINGCHANGE = 0x001A; const int HWND_BROADCAST = 0xffff;IntPtr result1;public enum SendMessageTimeoutFlags : uint { SMTO_NORMAL = 0x0000, SMTO_BLOCK = 0x0001, SMTO_ABORTIFHUNG = 0x0002, SMTO_NOTIMEOUTIFNOTHUNG = 0x0008 } [DllImport("user32.dll", SetLastError 阅读全文
posted @ 2012-04-09 22:37 scgw 阅读(581) 评论(0) 推荐(0) 编辑
摘要: c#中禁用和开启网卡using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Management;using System.Collections;namespace NetWorkControl{ public partial class Form1 : Form { public Form1() ... 阅读全文
posted @ 2012-04-09 14:43 scgw 阅读(935) 评论(0) 推荐(0) 编辑
摘要: 修改ip,子网掩码,网关,dns。"网络连接名"是你机器上网络属性里看到的连接名,把下面改成自己的连接名。netsh interface ip set address "网络连接名" static192.168.0.88 255.255.255.0192.168.0.1 1netsh interface ip set dns "网络连接名" static 202.216.224.66netsh interface ip add dns "网络连接名" 202.216.224.67 如果要改成动态分配ip和自动获得d 阅读全文
posted @ 2012-04-09 09:40 scgw 阅读(855) 评论(0) 推荐(0) 编辑