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.