#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <io.h>
#include <dos.h>
#include "conio.h"
#include <malloc.h>
void title();
void help();
int ScanLanid(char *str1,char *str2,char *str3,char *FileName);
void SetColor(int Script,int background);
int main(int argc,char *argv[])
{
title();
if(argc==5)
{
if(ScanLanid(argv[1],argv[2],argv[3],argv[4])==0)
return 0;
}
else
help();
return 1;
}
void title()
{
clrscr();
printf("------------------------------------------------------------------\n");
printf("ZRT Dos Scan Mac Address V1.0 -Ferex Incorporation,By BO,2017-7-19\n");
printf("------------------------------------------------------------------\n");
}
void help()
{
clrscr();/*清频*/
printf("-----------------------------------------------------------------\n");
printf("ZRT DOS Scan Mac Address- Ferex Incorporation,By ShenBo,2017-7-19\n");
printf("Usage :ZRTLANID.EXE[argv[1]][argv[2][argv[3][argv[4]]\n");
printf("\n");
printf("[Example]:\n");
printf("ScanMac.exe /nic=1 825993.eep MAC1 Lanid.BAT-->Create Scan Mac Address Batch\n");
}
int ScanLanid(char *str1,char *str2,char *str3,char *FileName)
{
char Buffer[255];
char Temp[255];
FILE *fp;
SetColor(2,0);
cprintf("Please Scan %s Address:",str3);
SetColor(7,0);
fgets(Buffer,255,stdin);
Buffer[strlen(Buffer)]='\0';
fp=fopen(FileName,"w+");
if(fp==NULL)
{
printf("Not Create %s File",FileName);
return 1;
}
strcpy(Temp,"eeupdate ");
strcat(Temp,str1);
strcat(Temp," -d ");
strcat(Temp,str2);
strcat(Temp," -mac ");
strcat(Temp,Buffer);
fputs(Temp,fp);
fclose(fp);
return 0;
}
void SetColor(int Script,int background)
{
textbackground(background);/*set background*/
textcolor(Script);/*set font*/
}
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <io.h>
#include <dos.h>
#include "conio.h"
#include <malloc.h>
void title();
void help();
int ScanLanid(char *str1,char *str2,char *str3,char *FileName);
void SetColor(int Script,int background);
int main(int argc,char *argv[])
{
title();
if(argc==5)
{
if(ScanLanid(argv[1],argv[2],argv[3],argv[4])==0)
return 0;
}
else
help();
return 1;
}
void title()
{
clrscr();
printf("------------------------------------------------------------------\n");
printf("ZRT Dos Scan Mac Address V1.0 -Ferex Incorporation,By BO,2017-7-19\n");
printf("------------------------------------------------------------------\n");
}
void help()
{
clrscr();/*清频*/
printf("-----------------------------------------------------------------\n");
printf("ZRT DOS Scan Mac Address- Ferex Incorporation,By ShenBo,2017-7-19\n");
printf("Usage :ZRTLANID.EXE[argv[1]][argv[2][argv[3][argv[4]]\n");
printf("\n");
printf("[Example]:\n");
printf("ScanMac.exe /nic=1 825993.eep MAC1 Lanid.BAT-->Create Scan Mac Address Batch\n");
}
int ScanLanid(char *str1,char *str2,char *str3,char *FileName)
{
char Buffer[255];
char Temp[255];
FILE *fp;
SetColor(2,0);
cprintf("Please Scan %s Address:",str3);
SetColor(7,0);
fgets(Buffer,255,stdin);
Buffer[strlen(Buffer)]='\0';
fp=fopen(FileName,"w+");
if(fp==NULL)
{
printf("Not Create %s File",FileName);
return 1;
}
strcpy(Temp,"eeupdate ");
strcat(Temp,str1);
strcat(Temp," -d ");
strcat(Temp,str2);
strcat(Temp," -mac ");
strcat(Temp,Buffer);
fputs(Temp,fp);
fclose(fp);
return 0;
}
void SetColor(int Script,int background)
{
textbackground(background);/*set background*/
textcolor(Script);/*set font*/
}