洼,要求太高了,自己改吧
//bbsd.c
void loadhosts() {
FILE *fp;
char tmphost[80], tmp[80], tmpip[80];
h_total=0;
fp=fopen("etc/hosts", "r");
while(1) {
bzero(tmphost, 80);
if(fscanf(fp, "%s %s %s %s", tmphost, tmp, tmp, tmpip)<0) break;
strncpy(h_str[h_total], tmphost, 28);
ip[h_total]=inet_addr(tmpip);
if(h_total++>=1999) break;
}
fclose(fp);
}
【 在 woolgate.bbs@bbs.hhu.edu.cn (woolgate) 的大作中提到: 】
: 我修改了~bbs/etc/hosts文件的这个IP,然后重启,嘿,又显示为新的IP了
: 不过,现在www方式登陆的仍显示为IP, 不过好多了
: 原来我可能只用www代理测试了一下,不够全面
: 不过怎样才能使~bbs/etc/hosts修改后不用重启呢?
: 还有这个文件可以设置区段
: 比如 某某工作室 has address 202.119.11.1~202.119.11.255 该怎么设置?
: 【 在 woolgate (woolgate) 的大作中提到: 】
: : 我几乎把etc/hosts清了个空(除了第一行localhost)
: : 然后在~bbs/etc/hosts里添了几个IP
: : 然后重新启动服务器
: .................(以下省略)
--