C DOS环境Intel NETWORK CHIP 烧录程式

#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*/
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值