views:

135

answers:

1

Hi,

Is there a way to flush the DNS cache from a C# WPF app? The application would be running on either XP, Vista, or Windows 7.

+4  A: 

This may be the poor-man's solution, but you could use System.Diagnostics.Process to launch ipconfig /flushdns.

kbrimington
Might as well, seems a waste of effort to dig up the pinvoke.
Hans Passant
not a bad fallback - might wait to see if anyone else knows of something buried in the .net framework - you'd think it would be in the DNS class if anywhere, but I don't see anything there
Greg
As long as portability to other platforms isn't a concern, would go with this.
Mike Caron