问题描述
我正在使用此代码屏蔽网站.但它会阻止所有用户访问网站.我想阻止特定用户而不是所有用户访问网站.请建议我该怎么做.任何链接.建议等
我只想阻止系统上所有用户的网站.例如.系统中有两个用户,例如.鲍勃和吉米.我想阻止Bob的"www.facebook.com",而不是Jimmy的阻止.如果Jimmy登录系统,他可以访问"www.facebook.com".但是当Bob登录时,他无法访问.它是一个窗口应用程序.... ...我正在使用下面的代码.但是它阻止了所有用户
I am using this code for blocking website. but it block website for all user. i want to block website for specific user not for all user.please suggest me how to do this. any links. suggestion etc.
I want to block website on system for user only not for all user. For example. There is two user in system e.g . Bob and Jimmy . i want to block "www.facebook.com for Bob. not for Jimmy. If Jimmy log in system he can access "www.facebook.com". but when Bob login he can not access. its a window application.......I am using the below code.but it block for all user
String strpath = @"C:\Windows\System32\drivers\etc\hosts";
StreamWriter objstrWri = new StreamWriter(strpath , true);
String siteDtl= "\n 127.0.0.1 google.com";
objstrWri .Write(siteDtl);
objstrWri .Close();
推荐答案
function FindProxyForURL(url, host)
{
if (dnsDomainIs(host, ".facebook.com")) {
return "PROXY 127.0.0.1:80";
}
else {
return "DIRECT";
}
}
这篇关于如何阻止用户而非所有用户访问网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!