Click here to Skip to main content
15,885,216 members

Comments by NoorKaximi (Top 25 by date)

NoorKaximi 19-Feb-17 15:47pm View    
try
{
ManagementObjectSearcher searcher =
new ManagementObjectSearcher("root\\StandardCimv2",
"SELECT * FROM MSFT_NetAdapter");

foreach (ManagementObject queryObj in searcher.Get())
{
Console.WriteLine("-----------------------------------");
Console.WriteLine("Name: {0}", queryObj["Name"]);

Console.WriteLine("PromiscuousMode: {0}", queryObj["PromiscuousMode"]);

}
}
catch (ManagementException e)
{
MessageBox.Show("An error occurred while querying for WMI data: " + e.Message);
}
I tried the above code but it is not working it return promiscuous mode false although i have enabled it using wireshark. Wireshark show promiscuous mode is enabled but wmi query return false for promiscuous mode
NoorKaximi 19-Feb-17 7:04am View    
I have deleted extra codes.
It is the main function through which i am trying to achieve my goal.
NoorKaximi 19-Feb-17 6:55am View    
i don't think making it cyclic will work...
NoorKaximi 19-Feb-17 6:48am View    
Kindly provide me complete code...
NoorKaximi 19-Feb-17 6:48am View    
i just want to check whether promiscuous mode is enabled or not on my PC.