i write a small function which call system to execute a command
the input is a ip address
which will send a command to ipblocker.exe to block the given ip
1 2 3 4 5 6
void autoblocknow(TCHAR* m_szIp)
{
TCHAR* ip =m_szIp;
system("ipblocker.exe block=ip,255.255.255.255");
}
but i wont work =(
ip is not being sent to command
Does opening a command window and typing exactly ipblocker.exe block=ip,255.255.255.255 work?
That aside, this is not the best way to do this. Your operating system comes with decicated functions meant for just this sort of thing. Using system is expensive and its only advantage is its cross-platform capabilities. Since this code is inherently not cross-platform, relying on the existence of the program ipblocker, you can abandon system and use something better.