You can use a function from Microsoft's "dnsapi.dll". This will allow you to do this completely programmatically:
using System.Runtime.InteropServices;
[DllImport("dnsapi.dll",EntryPoint="DnsFlushResolverCache")]
private static extern UInt32 DnsFlushResolverCache ();
public static void FlushMyCache() //This can be named whatever name you want and is the function you will call
{
UInt32 result = DnsFlushResolverCache();
}
I have tested this and it works great.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…