2
Vote

How to update linq to wmi for SubmitChange()?

description

I want to change my ipaddress with linq to wmi,but I do not know how to update linq to wmi for SubmitChange.
WmiContext context = new WmiContext(@"\\."); var ipaddress = from ip in context.Source<Win32_NetworkAdapterConfiguration>() select ip;
            foreach (Win32_NetworkAdapterConfiguration ip in ipaddress)
            {
                if (ip.IPAddress != null)
                {
                    ip.IPAddress.SetValue("192.168.8.20", 0);
 
                 //how to SubmitChange?
                }
            }
 
    My email:niphone@live.cn

comments