UNIX板の皆様 閉鎖の危機にまた立ち上がって
at UNIX
759:win32
07/01/13 03:06:33
とりあえず動くようだ。
// Visual C/C++ windows32 project
#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <shlobj.h>//needs shell32.lib
int main(int argc, char * argv[])
{
FILE * fdHosts;
char szSystemPath[MAX_PATH];
char szHostsPath[MAX_PATH];
SHGetFolderPath(NULL,CSIDL_SYSTEM , NULL, 0, szSystemPath);
sprintf( szHostsPath, "%s\\drivers\\etc\\hosts" ,szSystemPath );
printf( szHostsPath );
fdHosts = fopen( szHostsPath, "a" );//例外処理は省略
fprintf( fdHosts, "#\n" );
fprintf( fdHosts, "pc10.2ch.net 206.223.148.200\n" );
fprintf( fdHosts, "pc9.2ch.net 206.223.147.60\n" );
//のこりのサーバ
//
//
fclose( fdHosts );
return 0;
}
次ページ最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
5086日前に更新/229 KB
担当:undef