标签:div ddr stdcall document sap bsp declare doc nap
效果等同于ipconfig /flushdns 命令。
DnsFlushResolverCache 函数是在Dnsapi.dll导出,该函数没有任何参数。MSDN中找不到他,看来是个Undocumented函数,函数原型:
BOOL WINAPI DnsFlushResolverCache(VOID);
BOOL __stdcall DnsFlushResolverCache() { BOOL bRet = FALSE; typedef BOOL (WINAPI *PfuncDnsFlushResolverCache)(VOID); HMODULE hDnsModule = LoadLibrary( _T("dnsapi.dll") ); if ( hDnsModule != NULL ) { PfuncDnsFlushResolverCache pFlushFun = GetProcAddress( hDnsModule, "DnsFlushResolverCache" ); if ( pFlushFun != NULL ) { pFlushFun(); bRet = TRUE; } FreeLibrary( hDnsModule ); } return bRet; }
vb6 申明:
Private Declare Function DnsFlushResolverCache Lib "dnsapi.dll" () As Long
DnsFlushResolverCache 清除windows DNS缓存
标签:div ddr stdcall document sap bsp declare doc nap
原文地址:http://www.cnblogs.com/tanweizlf/p/6764748.html