来帮忙看看程序。为什么exe执行文件一直报“另一个程序正在使用此文件”
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include<io.h>
#include<string.h>
void main()
{
int exist;
exist = access("IPresult.txt",0);
system("echo Now searching for available IP address...");
if(!exist)
{
system("del IPresult.txt");
system("echo delete original IPresult... ");
system("echo wait...");
}
system("for /l %i in (20,1,22) do @ping 192.168.4.%i -n 1 >> IPresult.txt");
system("echo end");
system("pause");
system("taskkill /f /im cmd.exe");
}
VC6 在编辑窗可以正常运行,可是exe文件就一直报“另一个程序正在使用此文件,进程无法访问”