How is the default interface to start scanning is persisted?
I need to specify an interface, so that the program would automatically start scanning.
I've found the code that does that:
NetworkInterface netInterface = InterfaceManager.Instance.LastInterface;
if (netInterface != null)
Debug.WriteLine("We have a last interface, start scanning with it.");
//Set the interface
scanner.Interface = netInterface;
But where was that "LastInterface" saved?
How do I specify my own?
Tyler answered this for you on the other thread, you might not have saw it because it went onto a new page
Originally Posted by Tyler
Yeah, I may just answer
The InterfaceManager.LastInterface is saved in the ScanController.Interface property setter. The LastInterface property takes the last saved interface ID and tries to find the matching NetworkInterface object.
As for setting one yourself, well, are you trying to hard-code in an interface to scan with? If so, you could set netInterface to the network interface you want to use (you can get a list of interfaces from NetworkInterface.GetAllNetworkInterfaces())