Hi, I was implementing in a program WinForm write in C# a method that change
the DNS Sufix of networkcard of PC, well I search in the .NET documenttion
and I found a class that allow this feature, the class
"Win32_NetworkAdapterConfiguration" with the method "SetDNSSuffixSearchOrder"
that receive when argument the string array "DNSDomainSuffixSearchOrder[]"
that it would have to be the new suffix. I write in code this implemetation
but I ever receive a error when it tries to change the suffix. My code is:
using System.Management;
public static void SetaSufixo()
{
ManagementClass suffix = new
ManagementClass("Win32_NetworkAdapterConfiguration ");
ManagementBaseObject newSuffix =
suffix.GetMethodParameters("SetDNSSuffixSearchOrde r");
newSuffix ["DNSDomainSuffixSearchOrder"] = "any value";
suffix.InvokeMethod ("SetDNSSuffixSearchOrder", newSuffix, null);
}
Somepeople has a ideia of as I I decide this problem?
Sorry my english =(
Tks
Bruno
--
C# .NET Developer