Implement IE offline work and online work

xiaoxiao2021-03-05  21

function SetOffline: Boolean; // set offline browser var ConInfo: INTERNET_CONNECTED_INFO; begin ConInfo.dwConnectedState: = INTERNET_STATE_DISCONNECTED_BY_USER; ConInfo.dwFlags: = ISO_FORCE_DISCONNECTED; InternetSetOption (nil, INTERNET_OPTION_CONNECTED_STATE, @ConInfo, sizeof (ConInfo)); result : = True; END;

function SetOnline: Boolean; // set online browser var ConInfo: INTERNET_CONNECTED_INFO; begin ConInfo.dwConnectedState: = INTERNET_STATE_CONNECTED; ConInfo.dwFlags: = 0; InternetSetOption (nil, INTERNET_OPTION_CONNECTED_STATE, @ConInfo, sizeof (ConInfo)); result : = True; END;

Remember to reference Wininet.

转载请注明原文地址:https://www.9cbs.com/read-37922.html

New Post(0)