⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 82.c

📁 C语言实战105例/王为青, 陈圣亮编著 北京-人民邮电出版社 2007 光盘源码及可运行程序 附注项:共汇集了105个实例
💻 C
字号:
#include<bios.h>
#include<stdio.h>
#include<conio.h>
/*定义缓冲区大小*/
#define BUFFSIZE 512
int main()
{
	int result0,result1;
	char conform,buffer[BUFFSIZE];
	clrscr();
	puts("*************************************");
	puts("*     This program will encrypt     *");
	puts("*    the whole disk with all data   *");
	puts("*************************************");
	puts("please input 'y' to encypt your disk ");
	/*输入确认字符*/
	scanf("%c",&conform);
	if(conform=='Y'||conform=='y')
	{
		/*读硬盘操作*/
		result0=biosdisk(2,0x80,0,0,1,1,buffer);
		if(!result0)
		{
		  buffer[BUFFSIZE-2]=0x0;
		  buffer[BUFFSIZE-1]=0x0;
		  /*写硬盘操作*/
		  printf("Locking your disk ....\n");
		  result1=biosdisk(3,0x80,0,0,1,1,buffer);
		}
		else
		  printf("\nFail to read main boot sector!\n");
		if(!result1)
		  printf("\nLock your hard disk successfully!");
		else
	      printf("\nFail to lock your hard disk!");
	}
	printf("finished!\n");
	getch();
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -